Fossil SCM
Update the built-in SQLite to another 3.14 alpha version.
Commit
59bf47b2d5b0ed3136430dbcd8607824ce979b16
Parent
84f55ef7f084995…
2 files changed
+837
-781
+464
-450
+837
-781
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -65,10 +65,18 @@ | ||
| 65 | 65 | ** In all cases, the special comment must be enclosed in the usual |
| 66 | 66 | ** slash-asterisk...asterisk-slash comment marks, with no spaces between the |
| 67 | 67 | ** asterisks and the comment text. |
| 68 | 68 | */ |
| 69 | 69 | |
| 70 | +/* | |
| 71 | +** Make sure the Tcl calling convention macro is defined. This macro is | |
| 72 | +** only used by test code and Tcl integration code. | |
| 73 | +*/ | |
| 74 | +#ifndef SQLITE_TCLAPI | |
| 75 | +# define SQLITE_TCLAPI | |
| 76 | +#endif | |
| 77 | + | |
| 70 | 78 | /* |
| 71 | 79 | ** Make sure that rand_s() is available on Windows systems with MSVC 2005 |
| 72 | 80 | ** or higher. |
| 73 | 81 | */ |
| 74 | 82 | #if defined(_MSC_VER) && _MSC_VER>=1400 |
| @@ -304,12 +312,21 @@ | ||
| 304 | 312 | # define SQLITE_API |
| 305 | 313 | #endif |
| 306 | 314 | #ifndef SQLITE_CDECL |
| 307 | 315 | # define SQLITE_CDECL |
| 308 | 316 | #endif |
| 317 | +#ifndef SQLITE_APICALL | |
| 318 | +# define SQLITE_APICALL | |
| 319 | +#endif | |
| 309 | 320 | #ifndef SQLITE_STDCALL |
| 310 | -# define SQLITE_STDCALL | |
| 321 | +# define SQLITE_STDCALL SQLITE_APICALL | |
| 322 | +#endif | |
| 323 | +#ifndef SQLITE_CALLBACK | |
| 324 | +# define SQLITE_CALLBACK | |
| 325 | +#endif | |
| 326 | +#ifndef SQLITE_SYSAPI | |
| 327 | +# define SQLITE_SYSAPI | |
| 311 | 328 | #endif |
| 312 | 329 | |
| 313 | 330 | /* |
| 314 | 331 | ** These no-op macros are used in front of interfaces to mark those |
| 315 | 332 | ** interfaces as either deprecated or experimental. New applications |
| @@ -363,11 +380,11 @@ | ||
| 363 | 380 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 364 | 381 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 365 | 382 | */ |
| 366 | 383 | #define SQLITE_VERSION "3.14.0" |
| 367 | 384 | #define SQLITE_VERSION_NUMBER 3014000 |
| 368 | -#define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586" | |
| 385 | +#define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914" | |
| 369 | 386 | |
| 370 | 387 | /* |
| 371 | 388 | ** CAPI3REF: Run-Time Library Version Numbers |
| 372 | 389 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 373 | 390 | ** |
| @@ -396,13 +413,13 @@ | ||
| 396 | 413 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 397 | 414 | ** |
| 398 | 415 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 399 | 416 | */ |
| 400 | 417 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 401 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void); | |
| 402 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void); | |
| 403 | -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void); | |
| 418 | +SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void); | |
| 419 | +SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void); | |
| 420 | +SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void); | |
| 404 | 421 | |
| 405 | 422 | /* |
| 406 | 423 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 407 | 424 | ** |
| 408 | 425 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| @@ -423,12 +440,12 @@ | ||
| 423 | 440 | ** |
| 424 | 441 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 425 | 442 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 426 | 443 | */ |
| 427 | 444 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 428 | -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName); | |
| 429 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N); | |
| 445 | +SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName); | |
| 446 | +SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N); | |
| 430 | 447 | #endif |
| 431 | 448 | |
| 432 | 449 | /* |
| 433 | 450 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 434 | 451 | ** |
| @@ -463,11 +480,11 @@ | ||
| 463 | 480 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 464 | 481 | ** is unchanged by calls to sqlite3_config().)^ |
| 465 | 482 | ** |
| 466 | 483 | ** See the [threading mode] documentation for additional information. |
| 467 | 484 | */ |
| 468 | -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void); | |
| 485 | +SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void); | |
| 469 | 486 | |
| 470 | 487 | /* |
| 471 | 488 | ** CAPI3REF: Database Connection Handle |
| 472 | 489 | ** KEYWORDS: {database connection} {database connections} |
| 473 | 490 | ** |
| @@ -560,19 +577,19 @@ | ||
| 560 | 577 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 561 | 578 | ** [sqlite3_open_v2()], and not previously closed. |
| 562 | 579 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 563 | 580 | ** argument is a harmless no-op. |
| 564 | 581 | */ |
| 565 | -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*); | |
| 566 | -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*); | |
| 582 | +SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*); | |
| 583 | +SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*); | |
| 567 | 584 | |
| 568 | 585 | /* |
| 569 | 586 | ** The type for a callback function. |
| 570 | 587 | ** This is legacy and deprecated. It is included for historical |
| 571 | 588 | ** compatibility and is not documented. |
| 572 | 589 | */ |
| 573 | -typedef int (*sqlite3_callback)(void*,int,char**, char**); | |
| 590 | +typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); | |
| 574 | 591 | |
| 575 | 592 | /* |
| 576 | 593 | ** CAPI3REF: One-Step Query Execution Interface |
| 577 | 594 | ** METHOD: sqlite3 |
| 578 | 595 | ** |
| @@ -632,14 +649,14 @@ | ||
| 632 | 649 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 633 | 650 | ** <li> The application must not modify the SQL statement text passed into |
| 634 | 651 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 635 | 652 | ** </ul> |
| 636 | 653 | */ |
| 637 | -SQLITE_API int SQLITE_STDCALL sqlite3_exec( | |
| 654 | +SQLITE_API int SQLITE_APICALL sqlite3_exec( | |
| 638 | 655 | sqlite3*, /* An open database */ |
| 639 | 656 | const char *sql, /* SQL to be evaluated */ |
| 640 | - int (*callback)(void*,int,char**,char**), /* Callback function */ | |
| 657 | + int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */ | |
| 641 | 658 | void *, /* 1st argument to callback */ |
| 642 | 659 | char **errmsg /* Error msg written here */ |
| 643 | 660 | ); |
| 644 | 661 | |
| 645 | 662 | /* |
| @@ -983,30 +1000,30 @@ | ||
| 983 | 1000 | ** database corruption. |
| 984 | 1001 | */ |
| 985 | 1002 | typedef struct sqlite3_io_methods sqlite3_io_methods; |
| 986 | 1003 | struct sqlite3_io_methods { |
| 987 | 1004 | int iVersion; |
| 988 | - int (*xClose)(sqlite3_file*); | |
| 989 | - int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); | |
| 990 | - int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); | |
| 991 | - int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); | |
| 992 | - int (*xSync)(sqlite3_file*, int flags); | |
| 993 | - int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); | |
| 994 | - int (*xLock)(sqlite3_file*, int); | |
| 995 | - int (*xUnlock)(sqlite3_file*, int); | |
| 996 | - int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); | |
| 997 | - int (*xFileControl)(sqlite3_file*, int op, void *pArg); | |
| 998 | - int (*xSectorSize)(sqlite3_file*); | |
| 999 | - int (*xDeviceCharacteristics)(sqlite3_file*); | |
| 1005 | + int (SQLITE_CALLBACK *xClose)(sqlite3_file*); | |
| 1006 | + int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); | |
| 1007 | + int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); | |
| 1008 | + int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size); | |
| 1009 | + int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags); | |
| 1010 | + int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); | |
| 1011 | + int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int); | |
| 1012 | + int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int); | |
| 1013 | + int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut); | |
| 1014 | + int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg); | |
| 1015 | + int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*); | |
| 1016 | + int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*); | |
| 1000 | 1017 | /* Methods above are valid for version 1 */ |
| 1001 | - int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); | |
| 1002 | - int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); | |
| 1003 | - void (*xShmBarrier)(sqlite3_file*); | |
| 1004 | - int (*xShmUnmap)(sqlite3_file*, int deleteFlag); | |
| 1018 | + int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); | |
| 1019 | + int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags); | |
| 1020 | + void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*); | |
| 1021 | + int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag); | |
| 1005 | 1022 | /* Methods above are valid for version 2 */ |
| 1006 | - int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); | |
| 1007 | - int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); | |
| 1023 | + int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); | |
| 1024 | + int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); | |
| 1008 | 1025 | /* Methods above are valid for version 3 */ |
| 1009 | 1026 | /* Additional methods may be added in future releases */ |
| 1010 | 1027 | }; |
| 1011 | 1028 | |
| 1012 | 1029 | /* |
| @@ -1178,11 +1195,11 @@ | ||
| 1178 | 1195 | ** ^The [SQLITE_FCNTL_BUSYHANDLER] |
| 1179 | 1196 | ** file-control may be invoked by SQLite on the database file handle |
| 1180 | 1197 | ** shortly after it is opened in order to provide a custom VFS with access |
| 1181 | 1198 | ** to the connections busy-handler callback. The argument is of type (void **) |
| 1182 | 1199 | ** - an array of two (void *) values. The first (void *) actually points |
| 1183 | -** to a function of type (int (*)(void *)). In order to invoke the connections | |
| 1200 | +** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections | |
| 1184 | 1201 | ** busy-handler, this function should be invoked with the second (void *) in |
| 1185 | 1202 | ** the array as the only argument. If it returns non-zero, then the operation |
| 1186 | 1203 | ** should be retried. If it returns zero, the custom VFS should abandon the |
| 1187 | 1204 | ** current operation. |
| 1188 | 1205 | ** |
| @@ -1444,43 +1461,43 @@ | ||
| 1444 | 1461 | ** or all of these interfaces to be NULL or for their behavior to change |
| 1445 | 1462 | ** from one release to the next. Applications must not attempt to access |
| 1446 | 1463 | ** any of these methods if the iVersion of the VFS is less than 3. |
| 1447 | 1464 | */ |
| 1448 | 1465 | typedef struct sqlite3_vfs sqlite3_vfs; |
| 1449 | -typedef void (*sqlite3_syscall_ptr)(void); | |
| 1466 | +typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void); | |
| 1450 | 1467 | struct sqlite3_vfs { |
| 1451 | 1468 | int iVersion; /* Structure version number (currently 3) */ |
| 1452 | 1469 | int szOsFile; /* Size of subclassed sqlite3_file */ |
| 1453 | 1470 | int mxPathname; /* Maximum file pathname length */ |
| 1454 | 1471 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1455 | 1472 | const char *zName; /* Name of this virtual file system */ |
| 1456 | 1473 | void *pAppData; /* Pointer to application-specific data */ |
| 1457 | - int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, | |
| 1474 | + int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, | |
| 1458 | 1475 | int flags, int *pOutFlags); |
| 1459 | - int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); | |
| 1460 | - int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); | |
| 1461 | - int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); | |
| 1462 | - void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); | |
| 1463 | - void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); | |
| 1464 | - void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); | |
| 1465 | - void (*xDlClose)(sqlite3_vfs*, void*); | |
| 1466 | - int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); | |
| 1467 | - int (*xSleep)(sqlite3_vfs*, int microseconds); | |
| 1468 | - int (*xCurrentTime)(sqlite3_vfs*, double*); | |
| 1469 | - int (*xGetLastError)(sqlite3_vfs*, int, char *); | |
| 1476 | + int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir); | |
| 1477 | + int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); | |
| 1478 | + int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); | |
| 1479 | + void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename); | |
| 1480 | + void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); | |
| 1481 | + void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); | |
| 1482 | + void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*); | |
| 1483 | + int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut); | |
| 1484 | + int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds); | |
| 1485 | + int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*); | |
| 1486 | + int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *); | |
| 1470 | 1487 | /* |
| 1471 | 1488 | ** The methods above are in version 1 of the sqlite_vfs object |
| 1472 | 1489 | ** definition. Those that follow are added in version 2 or later |
| 1473 | 1490 | */ |
| 1474 | - int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); | |
| 1491 | + int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); | |
| 1475 | 1492 | /* |
| 1476 | 1493 | ** The methods above are in versions 1 and 2 of the sqlite_vfs object. |
| 1477 | 1494 | ** Those below are for version 3 and greater. |
| 1478 | 1495 | */ |
| 1479 | - int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); | |
| 1480 | - sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1481 | - const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1496 | + int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); | |
| 1497 | + sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1498 | + const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1482 | 1499 | /* |
| 1483 | 1500 | ** The methods above are in versions 1 through 3 of the sqlite_vfs object. |
| 1484 | 1501 | ** New fields may be appended in future versions. The iVersion |
| 1485 | 1502 | ** value will increment whenever this happens. |
| 1486 | 1503 | */ |
| @@ -1621,14 +1638,14 @@ | ||
| 1621 | 1638 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1622 | 1639 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1623 | 1640 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1624 | 1641 | ** failure. |
| 1625 | 1642 | */ |
| 1626 | -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); | |
| 1627 | -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); | |
| 1628 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); | |
| 1629 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void); | |
| 1643 | +SQLITE_API int SQLITE_APICALL sqlite3_initialize(void); | |
| 1644 | +SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void); | |
| 1645 | +SQLITE_API int SQLITE_APICALL sqlite3_os_init(void); | |
| 1646 | +SQLITE_API int SQLITE_APICALL sqlite3_os_end(void); | |
| 1630 | 1647 | |
| 1631 | 1648 | /* |
| 1632 | 1649 | ** CAPI3REF: Configuring The SQLite Library |
| 1633 | 1650 | ** |
| 1634 | 1651 | ** The sqlite3_config() interface is used to make global configuration |
| @@ -1743,17 +1760,17 @@ | ||
| 1743 | 1760 | ** SQLite will never invoke xInit() more than once without an intervening |
| 1744 | 1761 | ** call to xShutdown(). |
| 1745 | 1762 | */ |
| 1746 | 1763 | typedef struct sqlite3_mem_methods sqlite3_mem_methods; |
| 1747 | 1764 | struct sqlite3_mem_methods { |
| 1748 | - void *(*xMalloc)(int); /* Memory allocation function */ | |
| 1749 | - void (*xFree)(void*); /* Free a prior allocation */ | |
| 1750 | - void *(*xRealloc)(void*,int); /* Resize an allocation */ | |
| 1751 | - int (*xSize)(void*); /* Return the size of an allocation */ | |
| 1752 | - int (*xRoundup)(int); /* Round up request size to allocation size */ | |
| 1753 | - int (*xInit)(void*); /* Initialize the memory allocator */ | |
| 1754 | - void (*xShutdown)(void*); /* Deinitialize the memory allocator */ | |
| 1765 | + void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */ | |
| 1766 | + void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */ | |
| 1767 | + void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */ | |
| 1768 | + int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */ | |
| 1769 | + int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */ | |
| 1770 | + int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */ | |
| 1771 | + void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */ | |
| 1755 | 1772 | void *pAppData; /* Argument to xInit() and xShutdown() */ |
| 1756 | 1773 | }; |
| 1757 | 1774 | |
| 1758 | 1775 | /* |
| 1759 | 1776 | ** CAPI3REF: Configuration Options |
| @@ -1966,11 +1983,11 @@ | ||
| 1966 | 1983 | ** |
| 1967 | 1984 | ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt> |
| 1968 | 1985 | ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite |
| 1969 | 1986 | ** global [error log]. |
| 1970 | 1987 | ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a |
| 1971 | -** function with a call signature of void(*)(void*,int,const char*), | |
| 1988 | +** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*), | |
| 1972 | 1989 | ** and a pointer to void. ^If the function pointer is not NULL, it is |
| 1973 | 1990 | ** invoked by [sqlite3_log()] to process each logging event. ^If the |
| 1974 | 1991 | ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. |
| 1975 | 1992 | ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is |
| 1976 | 1993 | ** passed through as the first parameter to the application-defined logger |
| @@ -2019,11 +2036,11 @@ | ||
| 2019 | 2036 | ** |
| 2020 | 2037 | ** [[SQLITE_CONFIG_SQLLOG]] |
| 2021 | 2038 | ** <dt>SQLITE_CONFIG_SQLLOG |
| 2022 | 2039 | ** <dd>This option is only available if sqlite is compiled with the |
| 2023 | 2040 | ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should |
| 2024 | -** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). | |
| 2041 | +** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int). | |
| 2025 | 2042 | ** The second should be of type (void*). The callback is invoked by the library |
| 2026 | 2043 | ** in three separate circumstances, identified by the value passed as the |
| 2027 | 2044 | ** fourth parameter. If the fourth parameter is 0, then the database connection |
| 2028 | 2045 | ** passed as the second argument has just been opened. The third argument |
| 2029 | 2046 | ** points to a buffer containing the name of the main database file. If the |
| @@ -2217,11 +2234,11 @@ | ||
| 2217 | 2234 | ** |
| 2218 | 2235 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 2219 | 2236 | ** [extended result codes] feature of SQLite. ^The extended result |
| 2220 | 2237 | ** codes are disabled by default for historical compatibility. |
| 2221 | 2238 | */ |
| 2222 | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff); | |
| 2239 | +SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff); | |
| 2223 | 2240 | |
| 2224 | 2241 | /* |
| 2225 | 2242 | ** CAPI3REF: Last Insert Rowid |
| 2226 | 2243 | ** METHOD: sqlite3 |
| 2227 | 2244 | ** |
| @@ -2269,11 +2286,11 @@ | ||
| 2269 | 2286 | ** function is running and thus changes the last insert [rowid], |
| 2270 | 2287 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2271 | 2288 | ** unpredictable and might not equal either the old or the new |
| 2272 | 2289 | ** last insert [rowid]. |
| 2273 | 2290 | */ |
| 2274 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*); | |
| 2291 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*); | |
| 2275 | 2292 | |
| 2276 | 2293 | /* |
| 2277 | 2294 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2278 | 2295 | ** METHOD: sqlite3 |
| 2279 | 2296 | ** |
| @@ -2322,11 +2339,11 @@ | ||
| 2322 | 2339 | ** |
| 2323 | 2340 | ** If a separate thread makes changes on the same database connection |
| 2324 | 2341 | ** while [sqlite3_changes()] is running then the value returned |
| 2325 | 2342 | ** is unpredictable and not meaningful. |
| 2326 | 2343 | */ |
| 2327 | -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*); | |
| 2344 | +SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*); | |
| 2328 | 2345 | |
| 2329 | 2346 | /* |
| 2330 | 2347 | ** CAPI3REF: Total Number Of Rows Modified |
| 2331 | 2348 | ** METHOD: sqlite3 |
| 2332 | 2349 | ** |
| @@ -2346,11 +2363,11 @@ | ||
| 2346 | 2363 | ** |
| 2347 | 2364 | ** If a separate thread makes changes on the same database connection |
| 2348 | 2365 | ** while [sqlite3_total_changes()] is running then the value |
| 2349 | 2366 | ** returned is unpredictable and not meaningful. |
| 2350 | 2367 | */ |
| 2351 | -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*); | |
| 2368 | +SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*); | |
| 2352 | 2369 | |
| 2353 | 2370 | /* |
| 2354 | 2371 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2355 | 2372 | ** METHOD: sqlite3 |
| 2356 | 2373 | ** |
| @@ -2386,11 +2403,11 @@ | ||
| 2386 | 2403 | ** that are started after the sqlite3_interrupt() call returns. |
| 2387 | 2404 | ** |
| 2388 | 2405 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2389 | 2406 | ** is running then bad things will likely happen. |
| 2390 | 2407 | */ |
| 2391 | -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*); | |
| 2408 | +SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*); | |
| 2392 | 2409 | |
| 2393 | 2410 | /* |
| 2394 | 2411 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2395 | 2412 | ** |
| 2396 | 2413 | ** These routines are useful during command-line input to determine if the |
| @@ -2421,12 +2438,12 @@ | ||
| 2421 | 2438 | ** UTF-8 string. |
| 2422 | 2439 | ** |
| 2423 | 2440 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2424 | 2441 | ** UTF-16 string in native byte order. |
| 2425 | 2442 | */ |
| 2426 | -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql); | |
| 2427 | -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql); | |
| 2443 | +SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql); | |
| 2444 | +SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql); | |
| 2428 | 2445 | |
| 2429 | 2446 | /* |
| 2430 | 2447 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2431 | 2448 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2432 | 2449 | ** METHOD: sqlite3 |
| @@ -2483,11 +2500,11 @@ | ||
| 2483 | 2500 | ** result in undefined behavior. |
| 2484 | 2501 | ** |
| 2485 | 2502 | ** A busy handler must not close the database connection |
| 2486 | 2503 | ** or [prepared statement] that invoked the busy handler. |
| 2487 | 2504 | */ |
| 2488 | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); | |
| 2505 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); | |
| 2489 | 2506 | |
| 2490 | 2507 | /* |
| 2491 | 2508 | ** CAPI3REF: Set A Busy Timeout |
| 2492 | 2509 | ** METHOD: sqlite3 |
| 2493 | 2510 | ** |
| @@ -2506,11 +2523,11 @@ | ||
| 2506 | 2523 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2507 | 2524 | ** this routine, that other busy handler is cleared.)^ |
| 2508 | 2525 | ** |
| 2509 | 2526 | ** See also: [PRAGMA busy_timeout] |
| 2510 | 2527 | */ |
| 2511 | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms); | |
| 2528 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms); | |
| 2512 | 2529 | |
| 2513 | 2530 | /* |
| 2514 | 2531 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2515 | 2532 | ** METHOD: sqlite3 |
| 2516 | 2533 | ** |
| @@ -2581,19 +2598,19 @@ | ||
| 2581 | 2598 | ** interface defined here. As a consequence, errors that occur in the |
| 2582 | 2599 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2583 | 2600 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2584 | 2601 | ** [sqlite3_errmsg()]. |
| 2585 | 2602 | */ |
| 2586 | -SQLITE_API int SQLITE_STDCALL sqlite3_get_table( | |
| 2603 | +SQLITE_API int SQLITE_APICALL sqlite3_get_table( | |
| 2587 | 2604 | sqlite3 *db, /* An open database */ |
| 2588 | 2605 | const char *zSql, /* SQL to be evaluated */ |
| 2589 | 2606 | char ***pazResult, /* Results of the query */ |
| 2590 | 2607 | int *pnRow, /* Number of result rows written here */ |
| 2591 | 2608 | int *pnColumn, /* Number of result columns written here */ |
| 2592 | 2609 | char **pzErrmsg /* Error msg written here */ |
| 2593 | 2610 | ); |
| 2594 | -SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result); | |
| 2611 | +SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result); | |
| 2595 | 2612 | |
| 2596 | 2613 | /* |
| 2597 | 2614 | ** CAPI3REF: Formatted String Printing Functions |
| 2598 | 2615 | ** |
| 2599 | 2616 | ** These routines are work-alikes of the "printf()" family of functions |
| @@ -2696,13 +2713,13 @@ | ||
| 2696 | 2713 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2697 | 2714 | ** addition that after the string has been read and copied into |
| 2698 | 2715 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2699 | 2716 | */ |
| 2700 | 2717 | SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2701 | -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); | |
| 2718 | +SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list); | |
| 2702 | 2719 | SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2703 | -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list); | |
| 2720 | +SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list); | |
| 2704 | 2721 | |
| 2705 | 2722 | /* |
| 2706 | 2723 | ** CAPI3REF: Memory Allocation Subsystem |
| 2707 | 2724 | ** |
| 2708 | 2725 | ** The SQLite core uses these three routines for all of its own |
| @@ -2788,16 +2805,16 @@ | ||
| 2788 | 2805 | ** |
| 2789 | 2806 | ** The application must not read or write any part of |
| 2790 | 2807 | ** a block of memory after it has been released using |
| 2791 | 2808 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2792 | 2809 | */ |
| 2793 | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int); | |
| 2794 | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64); | |
| 2795 | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int); | |
| 2796 | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64); | |
| 2797 | -SQLITE_API void SQLITE_STDCALL sqlite3_free(void*); | |
| 2798 | -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*); | |
| 2810 | +SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int); | |
| 2811 | +SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64); | |
| 2812 | +SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int); | |
| 2813 | +SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64); | |
| 2814 | +SQLITE_API void SQLITE_APICALL sqlite3_free(void*); | |
| 2815 | +SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*); | |
| 2799 | 2816 | |
| 2800 | 2817 | /* |
| 2801 | 2818 | ** CAPI3REF: Memory Allocator Statistics |
| 2802 | 2819 | ** |
| 2803 | 2820 | ** SQLite provides these two interfaces for reporting on the status |
| @@ -2818,12 +2835,12 @@ | ||
| 2818 | 2835 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2819 | 2836 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2820 | 2837 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2821 | 2838 | ** prior to the reset. |
| 2822 | 2839 | */ |
| 2823 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void); | |
| 2824 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag); | |
| 2840 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void); | |
| 2841 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag); | |
| 2825 | 2842 | |
| 2826 | 2843 | /* |
| 2827 | 2844 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2828 | 2845 | ** |
| 2829 | 2846 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| @@ -2842,11 +2859,11 @@ | ||
| 2842 | 2859 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2843 | 2860 | ** non-NULL P then the pseudo-randomness is generated |
| 2844 | 2861 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2845 | 2862 | ** method. |
| 2846 | 2863 | */ |
| 2847 | -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P); | |
| 2864 | +SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P); | |
| 2848 | 2865 | |
| 2849 | 2866 | /* |
| 2850 | 2867 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2851 | 2868 | ** METHOD: sqlite3 |
| 2852 | 2869 | ** |
| @@ -2925,13 +2942,13 @@ | ||
| 2925 | 2942 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2926 | 2943 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2927 | 2944 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2928 | 2945 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2929 | 2946 | */ |
| 2930 | -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( | |
| 2947 | +SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer( | |
| 2931 | 2948 | sqlite3*, |
| 2932 | - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), | |
| 2949 | + int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*), | |
| 2933 | 2950 | void *pUserData |
| 2934 | 2951 | ); |
| 2935 | 2952 | |
| 2936 | 2953 | /* |
| 2937 | 2954 | ** CAPI3REF: Authorizer Return Codes |
| @@ -3033,14 +3050,14 @@ | ||
| 3033 | 3050 | ** digits in the time are meaningless. Future versions of SQLite |
| 3034 | 3051 | ** might provide greater resolution on the profiler callback. The |
| 3035 | 3052 | ** sqlite3_profile() function is considered experimental and is |
| 3036 | 3053 | ** subject to change in future versions of SQLite. |
| 3037 | 3054 | */ |
| 3038 | -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*, | |
| 3039 | - void(*xTrace)(void*,const char*), void*); | |
| 3040 | -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*, | |
| 3041 | - void(*xProfile)(void*,const char*,sqlite3_uint64), void*); | |
| 3055 | +SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*, | |
| 3056 | + void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*); | |
| 3057 | +SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*, | |
| 3058 | + void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*); | |
| 3042 | 3059 | |
| 3043 | 3060 | /* |
| 3044 | 3061 | ** CAPI3REF: SQL Trace Event Codes |
| 3045 | 3062 | ** KEYWORDS: SQLITE_TRACE |
| 3046 | 3063 | ** |
| @@ -3124,14 +3141,14 @@ | ||
| 3124 | 3141 | ** |
| 3125 | 3142 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 3126 | 3143 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 3127 | 3144 | ** are deprecated. |
| 3128 | 3145 | */ |
| 3129 | -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( | |
| 3146 | +SQLITE_API int SQLITE_APICALL sqlite3_trace_v2( | |
| 3130 | 3147 | sqlite3*, |
| 3131 | 3148 | unsigned uMask, |
| 3132 | - int(*xCallback)(unsigned,void*,void*,void*), | |
| 3149 | + int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*), | |
| 3133 | 3150 | void *pCtx |
| 3134 | 3151 | ); |
| 3135 | 3152 | |
| 3136 | 3153 | /* |
| 3137 | 3154 | ** CAPI3REF: Query Progress Callbacks |
| @@ -3163,11 +3180,11 @@ | ||
| 3163 | 3180 | ** the database connection that invoked the progress handler. |
| 3164 | 3181 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 3165 | 3182 | ** database connections for the meaning of "modify" in this paragraph. |
| 3166 | 3183 | ** |
| 3167 | 3184 | */ |
| 3168 | -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); | |
| 3185 | +SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*); | |
| 3169 | 3186 | |
| 3170 | 3187 | /* |
| 3171 | 3188 | ** CAPI3REF: Opening A New Database Connection |
| 3172 | 3189 | ** CONSTRUCTOR: sqlite3 |
| 3173 | 3190 | ** |
| @@ -3392,19 +3409,19 @@ | ||
| 3392 | 3409 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3393 | 3410 | ** features that require the use of temporary files may fail. |
| 3394 | 3411 | ** |
| 3395 | 3412 | ** See also: [sqlite3_temp_directory] |
| 3396 | 3413 | */ |
| 3397 | -SQLITE_API int SQLITE_STDCALL sqlite3_open( | |
| 3414 | +SQLITE_API int SQLITE_APICALL sqlite3_open( | |
| 3398 | 3415 | const char *filename, /* Database filename (UTF-8) */ |
| 3399 | 3416 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3400 | 3417 | ); |
| 3401 | -SQLITE_API int SQLITE_STDCALL sqlite3_open16( | |
| 3418 | +SQLITE_API int SQLITE_APICALL sqlite3_open16( | |
| 3402 | 3419 | const void *filename, /* Database filename (UTF-16) */ |
| 3403 | 3420 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3404 | 3421 | ); |
| 3405 | -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( | |
| 3422 | +SQLITE_API int SQLITE_APICALL sqlite3_open_v2( | |
| 3406 | 3423 | const char *filename, /* Database filename (UTF-8) */ |
| 3407 | 3424 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3408 | 3425 | int flags, /* Flags */ |
| 3409 | 3426 | const char *zVfs /* Name of VFS module to use */ |
| 3410 | 3427 | ); |
| @@ -3446,13 +3463,13 @@ | ||
| 3446 | 3463 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3447 | 3464 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3448 | 3465 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3449 | 3466 | ** undesirable. |
| 3450 | 3467 | */ |
| 3451 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); | |
| 3452 | -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); | |
| 3453 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); | |
| 3468 | +SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); | |
| 3469 | +SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); | |
| 3470 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); | |
| 3454 | 3471 | |
| 3455 | 3472 | |
| 3456 | 3473 | /* |
| 3457 | 3474 | ** CAPI3REF: Error Codes And Messages |
| 3458 | 3475 | ** METHOD: sqlite3 |
| @@ -3492,15 +3509,15 @@ | ||
| 3492 | 3509 | ** |
| 3493 | 3510 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3494 | 3511 | ** was invoked incorrectly by the application. In that case, the |
| 3495 | 3512 | ** error code and message may or may not be set. |
| 3496 | 3513 | */ |
| 3497 | -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); | |
| 3498 | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); | |
| 3499 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); | |
| 3500 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); | |
| 3501 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int); | |
| 3514 | +SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db); | |
| 3515 | +SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db); | |
| 3516 | +SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*); | |
| 3517 | +SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*); | |
| 3518 | +SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int); | |
| 3502 | 3519 | |
| 3503 | 3520 | /* |
| 3504 | 3521 | ** CAPI3REF: Prepared Statement Object |
| 3505 | 3522 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3506 | 3523 | ** |
| @@ -3564,11 +3581,11 @@ | ||
| 3564 | 3581 | ** created by an untrusted script can be contained using the |
| 3565 | 3582 | ** [max_page_count] [PRAGMA]. |
| 3566 | 3583 | ** |
| 3567 | 3584 | ** New run-time limit categories may be added in future releases. |
| 3568 | 3585 | */ |
| 3569 | -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal); | |
| 3586 | +SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal); | |
| 3570 | 3587 | |
| 3571 | 3588 | /* |
| 3572 | 3589 | ** CAPI3REF: Run-Time Limit Categories |
| 3573 | 3590 | ** KEYWORDS: {limit category} {*limit categories} |
| 3574 | 3591 | ** |
| @@ -3716,32 +3733,32 @@ | ||
| 3716 | 3733 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3717 | 3734 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3718 | 3735 | ** </li> |
| 3719 | 3736 | ** </ol> |
| 3720 | 3737 | */ |
| 3721 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare( | |
| 3738 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare( | |
| 3722 | 3739 | sqlite3 *db, /* Database handle */ |
| 3723 | 3740 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3724 | 3741 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3725 | 3742 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3726 | 3743 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3727 | 3744 | ); |
| 3728 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( | |
| 3745 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2( | |
| 3729 | 3746 | sqlite3 *db, /* Database handle */ |
| 3730 | 3747 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3731 | 3748 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3732 | 3749 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3733 | 3750 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3734 | 3751 | ); |
| 3735 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( | |
| 3752 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare16( | |
| 3736 | 3753 | sqlite3 *db, /* Database handle */ |
| 3737 | 3754 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3738 | 3755 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3739 | 3756 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3740 | 3757 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3741 | 3758 | ); |
| 3742 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( | |
| 3759 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2( | |
| 3743 | 3760 | sqlite3 *db, /* Database handle */ |
| 3744 | 3761 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3745 | 3762 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3746 | 3763 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3747 | 3764 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| @@ -3776,12 +3793,12 @@ | ||
| 3776 | 3793 | ** automatically freed when the prepared statement is finalized. |
| 3777 | 3794 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3778 | 3795 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3779 | 3796 | ** by passing it to [sqlite3_free()]. |
| 3780 | 3797 | */ |
| 3781 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt); | |
| 3782 | -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); | |
| 3798 | +SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt); | |
| 3799 | +SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); | |
| 3783 | 3800 | |
| 3784 | 3801 | /* |
| 3785 | 3802 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3786 | 3803 | ** METHOD: sqlite3_stmt |
| 3787 | 3804 | ** |
| @@ -3809,11 +3826,11 @@ | ||
| 3809 | 3826 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3810 | 3827 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3811 | 3828 | ** change the configuration of a database connection, they do not make |
| 3812 | 3829 | ** changes to the content of the database files on disk. |
| 3813 | 3830 | */ |
| 3814 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); | |
| 3831 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); | |
| 3815 | 3832 | |
| 3816 | 3833 | /* |
| 3817 | 3834 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3818 | 3835 | ** METHOD: sqlite3_stmt |
| 3819 | 3836 | ** |
| @@ -3830,11 +3847,11 @@ | ||
| 3830 | 3847 | ** to locate all prepared statements associated with a database |
| 3831 | 3848 | ** connection that are in need of being reset. This can be used, |
| 3832 | 3849 | ** for example, in diagnostic routines to search for prepared |
| 3833 | 3850 | ** statements that are holding a transaction open. |
| 3834 | 3851 | */ |
| 3835 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*); | |
| 3852 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*); | |
| 3836 | 3853 | |
| 3837 | 3854 | /* |
| 3838 | 3855 | ** CAPI3REF: Dynamically Typed Value Object |
| 3839 | 3856 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3840 | 3857 | ** |
| @@ -3994,24 +4011,24 @@ | ||
| 3994 | 4011 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 3995 | 4012 | ** |
| 3996 | 4013 | ** See also: [sqlite3_bind_parameter_count()], |
| 3997 | 4014 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 3998 | 4015 | */ |
| 3999 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); | |
| 4000 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, | |
| 4001 | - void(*)(void*)); | |
| 4002 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double); | |
| 4003 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int); | |
| 4004 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); | |
| 4005 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int); | |
| 4006 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); | |
| 4007 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); | |
| 4008 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, | |
| 4009 | - void(*)(void*), unsigned char encoding); | |
| 4010 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); | |
| 4011 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); | |
| 4012 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); | |
| 4016 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*)); | |
| 4017 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, | |
| 4018 | + void(SQLITE_CALLBACK *)(void*)); | |
| 4019 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double); | |
| 4020 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int); | |
| 4021 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); | |
| 4022 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int); | |
| 4023 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*)); | |
| 4024 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 4025 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, | |
| 4026 | + void(SQLITE_CALLBACK *)(void*), unsigned char encoding); | |
| 4027 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); | |
| 4028 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); | |
| 4029 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); | |
| 4013 | 4030 | |
| 4014 | 4031 | /* |
| 4015 | 4032 | ** CAPI3REF: Number Of SQL Parameters |
| 4016 | 4033 | ** METHOD: sqlite3_stmt |
| 4017 | 4034 | ** |
| @@ -4028,11 +4045,11 @@ | ||
| 4028 | 4045 | ** |
| 4029 | 4046 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4030 | 4047 | ** [sqlite3_bind_parameter_name()], and |
| 4031 | 4048 | ** [sqlite3_bind_parameter_index()]. |
| 4032 | 4049 | */ |
| 4033 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*); | |
| 4050 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*); | |
| 4034 | 4051 | |
| 4035 | 4052 | /* |
| 4036 | 4053 | ** CAPI3REF: Name Of A Host Parameter |
| 4037 | 4054 | ** METHOD: sqlite3_stmt |
| 4038 | 4055 | ** |
| @@ -4056,11 +4073,11 @@ | ||
| 4056 | 4073 | ** |
| 4057 | 4074 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4058 | 4075 | ** [sqlite3_bind_parameter_count()], and |
| 4059 | 4076 | ** [sqlite3_bind_parameter_index()]. |
| 4060 | 4077 | */ |
| 4061 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); | |
| 4078 | +SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); | |
| 4062 | 4079 | |
| 4063 | 4080 | /* |
| 4064 | 4081 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 4065 | 4082 | ** METHOD: sqlite3_stmt |
| 4066 | 4083 | ** |
| @@ -4073,21 +4090,21 @@ | ||
| 4073 | 4090 | ** |
| 4074 | 4091 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4075 | 4092 | ** [sqlite3_bind_parameter_count()], and |
| 4076 | 4093 | ** [sqlite3_bind_parameter_name()]. |
| 4077 | 4094 | */ |
| 4078 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); | |
| 4095 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); | |
| 4079 | 4096 | |
| 4080 | 4097 | /* |
| 4081 | 4098 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 4082 | 4099 | ** METHOD: sqlite3_stmt |
| 4083 | 4100 | ** |
| 4084 | 4101 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 4085 | 4102 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 4086 | 4103 | ** ^Use this routine to reset all host parameters to NULL. |
| 4087 | 4104 | */ |
| 4088 | -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*); | |
| 4105 | +SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*); | |
| 4089 | 4106 | |
| 4090 | 4107 | /* |
| 4091 | 4108 | ** CAPI3REF: Number Of Columns In A Result Set |
| 4092 | 4109 | ** METHOD: sqlite3_stmt |
| 4093 | 4110 | ** |
| @@ -4095,11 +4112,11 @@ | ||
| 4095 | 4112 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 4096 | 4113 | ** statement that does not return data (for example an [UPDATE]). |
| 4097 | 4114 | ** |
| 4098 | 4115 | ** See also: [sqlite3_data_count()] |
| 4099 | 4116 | */ |
| 4100 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt); | |
| 4117 | +SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt); | |
| 4101 | 4118 | |
| 4102 | 4119 | /* |
| 4103 | 4120 | ** CAPI3REF: Column Names In A Result Set |
| 4104 | 4121 | ** METHOD: sqlite3_stmt |
| 4105 | 4122 | ** |
| @@ -4124,12 +4141,12 @@ | ||
| 4124 | 4141 | ** ^The name of a result column is the value of the "AS" clause for |
| 4125 | 4142 | ** that column, if there is an AS clause. If there is no AS clause |
| 4126 | 4143 | ** then the name of the column is unspecified and may change from |
| 4127 | 4144 | ** one release of SQLite to the next. |
| 4128 | 4145 | */ |
| 4129 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N); | |
| 4130 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N); | |
| 4146 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N); | |
| 4147 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N); | |
| 4131 | 4148 | |
| 4132 | 4149 | /* |
| 4133 | 4150 | ** CAPI3REF: Source Of Data In A Query Result |
| 4134 | 4151 | ** METHOD: sqlite3_stmt |
| 4135 | 4152 | ** |
| @@ -4173,16 +4190,16 @@ | ||
| 4173 | 4190 | ** If two or more threads call one or more |
| 4174 | 4191 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 4175 | 4192 | ** for the same [prepared statement] and result column |
| 4176 | 4193 | ** at the same time then the results are undefined. |
| 4177 | 4194 | */ |
| 4178 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); | |
| 4179 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); | |
| 4180 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); | |
| 4181 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); | |
| 4182 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); | |
| 4183 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int); | |
| 4195 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int); | |
| 4196 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int); | |
| 4197 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int); | |
| 4198 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int); | |
| 4199 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int); | |
| 4200 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int); | |
| 4184 | 4201 | |
| 4185 | 4202 | /* |
| 4186 | 4203 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 4187 | 4204 | ** METHOD: sqlite3_stmt |
| 4188 | 4205 | ** |
| @@ -4210,12 +4227,12 @@ | ||
| 4210 | 4227 | ** data stored in that column is of the declared type. SQLite is |
| 4211 | 4228 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 4212 | 4229 | ** is associated with individual values, not with the containers |
| 4213 | 4230 | ** used to hold those values. |
| 4214 | 4231 | */ |
| 4215 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int); | |
| 4216 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int); | |
| 4232 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int); | |
| 4233 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int); | |
| 4217 | 4234 | |
| 4218 | 4235 | /* |
| 4219 | 4236 | ** CAPI3REF: Evaluate An SQL Statement |
| 4220 | 4237 | ** METHOD: sqlite3_stmt |
| 4221 | 4238 | ** |
| @@ -4291,11 +4308,11 @@ | ||
| 4291 | 4308 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4292 | 4309 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4293 | 4310 | ** then the more specific [error codes] are returned directly |
| 4294 | 4311 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4295 | 4312 | */ |
| 4296 | -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*); | |
| 4313 | +SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*); | |
| 4297 | 4314 | |
| 4298 | 4315 | /* |
| 4299 | 4316 | ** CAPI3REF: Number of columns in a result set |
| 4300 | 4317 | ** METHOD: sqlite3_stmt |
| 4301 | 4318 | ** |
| @@ -4312,11 +4329,11 @@ | ||
| 4312 | 4329 | ** where it always returns zero since each step of that multi-step |
| 4313 | 4330 | ** pragma returns 0 columns of data. |
| 4314 | 4331 | ** |
| 4315 | 4332 | ** See also: [sqlite3_column_count()] |
| 4316 | 4333 | */ |
| 4317 | -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt); | |
| 4334 | +SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt); | |
| 4318 | 4335 | |
| 4319 | 4336 | /* |
| 4320 | 4337 | ** CAPI3REF: Fundamental Datatypes |
| 4321 | 4338 | ** KEYWORDS: SQLITE_TEXT |
| 4322 | 4339 | ** |
| @@ -4502,20 +4519,20 @@ | ||
| 4502 | 4519 | ** of these routines, a default value is returned. The default value |
| 4503 | 4520 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4504 | 4521 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4505 | 4522 | ** [SQLITE_NOMEM].)^ |
| 4506 | 4523 | */ |
| 4507 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol); | |
| 4508 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); | |
| 4509 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); | |
| 4510 | -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol); | |
| 4511 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol); | |
| 4512 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol); | |
| 4513 | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol); | |
| 4514 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol); | |
| 4515 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol); | |
| 4516 | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol); | |
| 4524 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol); | |
| 4525 | +SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); | |
| 4526 | +SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); | |
| 4527 | +SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol); | |
| 4528 | +SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol); | |
| 4529 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol); | |
| 4530 | +SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol); | |
| 4531 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol); | |
| 4532 | +SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol); | |
| 4533 | +SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol); | |
| 4517 | 4534 | |
| 4518 | 4535 | /* |
| 4519 | 4536 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4520 | 4537 | ** DESTRUCTOR: sqlite3_stmt |
| 4521 | 4538 | ** |
| @@ -4539,11 +4556,11 @@ | ||
| 4539 | 4556 | ** resource leaks. It is a grievous error for the application to try to use |
| 4540 | 4557 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4541 | 4558 | ** statement after it has been finalized can result in undefined and |
| 4542 | 4559 | ** undesirable behavior such as segfaults and heap corruption. |
| 4543 | 4560 | */ |
| 4544 | -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt); | |
| 4561 | +SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt); | |
| 4545 | 4562 | |
| 4546 | 4563 | /* |
| 4547 | 4564 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4548 | 4565 | ** METHOD: sqlite3_stmt |
| 4549 | 4566 | ** |
| @@ -4566,11 +4583,11 @@ | ||
| 4566 | 4583 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4567 | 4584 | ** |
| 4568 | 4585 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4569 | 4586 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4570 | 4587 | */ |
| 4571 | -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt); | |
| 4588 | +SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt); | |
| 4572 | 4589 | |
| 4573 | 4590 | /* |
| 4574 | 4591 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4575 | 4592 | ** KEYWORDS: {function creation routines} |
| 4576 | 4593 | ** KEYWORDS: {application-defined SQL function} |
| @@ -4666,40 +4683,40 @@ | ||
| 4666 | 4683 | ** ^An application-defined function is permitted to call other |
| 4667 | 4684 | ** SQLite interfaces. However, such calls must not |
| 4668 | 4685 | ** close the database connection nor finalize or reset the prepared |
| 4669 | 4686 | ** statement in which the function is running. |
| 4670 | 4687 | */ |
| 4671 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function( | |
| 4688 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function( | |
| 4672 | 4689 | sqlite3 *db, |
| 4673 | 4690 | const char *zFunctionName, |
| 4674 | 4691 | int nArg, |
| 4675 | 4692 | int eTextRep, |
| 4676 | 4693 | void *pApp, |
| 4677 | - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4678 | - void (*xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4679 | - void (*xFinal)(sqlite3_context*) | |
| 4694 | + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4695 | + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4696 | + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) | |
| 4680 | 4697 | ); |
| 4681 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( | |
| 4698 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function16( | |
| 4682 | 4699 | sqlite3 *db, |
| 4683 | 4700 | const void *zFunctionName, |
| 4684 | 4701 | int nArg, |
| 4685 | 4702 | int eTextRep, |
| 4686 | 4703 | void *pApp, |
| 4687 | - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4688 | - void (*xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4689 | - void (*xFinal)(sqlite3_context*) | |
| 4704 | + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4705 | + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4706 | + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) | |
| 4690 | 4707 | ); |
| 4691 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( | |
| 4708 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2( | |
| 4692 | 4709 | sqlite3 *db, |
| 4693 | 4710 | const char *zFunctionName, |
| 4694 | 4711 | int nArg, |
| 4695 | 4712 | int eTextRep, |
| 4696 | 4713 | void *pApp, |
| 4697 | - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4698 | - void (*xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4699 | - void (*xFinal)(sqlite3_context*), | |
| 4700 | - void(*xDestroy)(void*) | |
| 4714 | + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4715 | + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4716 | + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*), | |
| 4717 | + void(SQLITE_CALLBACK *xDestroy)(void*) | |
| 4701 | 4718 | ); |
| 4702 | 4719 | |
| 4703 | 4720 | /* |
| 4704 | 4721 | ** CAPI3REF: Text Encodings |
| 4705 | 4722 | ** |
| @@ -4732,16 +4749,16 @@ | ||
| 4732 | 4749 | ** to be supported. However, new applications should avoid |
| 4733 | 4750 | ** the use of these functions. To encourage programmers to avoid |
| 4734 | 4751 | ** these functions, we will not explain what they do. |
| 4735 | 4752 | */ |
| 4736 | 4753 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4737 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*); | |
| 4738 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*); | |
| 4739 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); | |
| 4740 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void); | |
| 4741 | -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void); | |
| 4742 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), | |
| 4754 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*); | |
| 4755 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*); | |
| 4756 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); | |
| 4757 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void); | |
| 4758 | +SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void); | |
| 4759 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int), | |
| 4743 | 4760 | void*,sqlite3_int64); |
| 4744 | 4761 | #endif |
| 4745 | 4762 | |
| 4746 | 4763 | /* |
| 4747 | 4764 | ** CAPI3REF: Obtaining SQL Values |
| @@ -4787,22 +4804,22 @@ | ||
| 4787 | 4804 | ** or [sqlite3_value_text16()]. |
| 4788 | 4805 | ** |
| 4789 | 4806 | ** These routines must be called from the same thread as |
| 4790 | 4807 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4791 | 4808 | */ |
| 4792 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*); | |
| 4793 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*); | |
| 4794 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*); | |
| 4795 | -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*); | |
| 4796 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*); | |
| 4797 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*); | |
| 4798 | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*); | |
| 4799 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*); | |
| 4800 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*); | |
| 4801 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*); | |
| 4802 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*); | |
| 4803 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*); | |
| 4809 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*); | |
| 4810 | +SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*); | |
| 4811 | +SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*); | |
| 4812 | +SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*); | |
| 4813 | +SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*); | |
| 4814 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*); | |
| 4815 | +SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*); | |
| 4816 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*); | |
| 4817 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*); | |
| 4818 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*); | |
| 4819 | +SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*); | |
| 4820 | +SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*); | |
| 4804 | 4821 | |
| 4805 | 4822 | /* |
| 4806 | 4823 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4807 | 4824 | ** METHOD: sqlite3_value |
| 4808 | 4825 | ** |
| @@ -4814,11 +4831,11 @@ | ||
| 4814 | 4831 | ** |
| 4815 | 4832 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4816 | 4833 | ** from the result of one [application-defined SQL function] into the |
| 4817 | 4834 | ** input of another. |
| 4818 | 4835 | */ |
| 4819 | -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*); | |
| 4836 | +SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*); | |
| 4820 | 4837 | |
| 4821 | 4838 | /* |
| 4822 | 4839 | ** CAPI3REF: Copy And Free SQL Values |
| 4823 | 4840 | ** METHOD: sqlite3_value |
| 4824 | 4841 | ** |
| @@ -4830,12 +4847,12 @@ | ||
| 4830 | 4847 | ** |
| 4831 | 4848 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4832 | 4849 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4833 | 4850 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4834 | 4851 | */ |
| 4835 | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*); | |
| 4836 | -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*); | |
| 4852 | +SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*); | |
| 4853 | +SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*); | |
| 4837 | 4854 | |
| 4838 | 4855 | /* |
| 4839 | 4856 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4840 | 4857 | ** METHOD: sqlite3_context |
| 4841 | 4858 | ** |
| @@ -4876,11 +4893,11 @@ | ||
| 4876 | 4893 | ** function. |
| 4877 | 4894 | ** |
| 4878 | 4895 | ** This routine must be called from the same thread in which |
| 4879 | 4896 | ** the aggregate SQL function is running. |
| 4880 | 4897 | */ |
| 4881 | -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); | |
| 4898 | +SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); | |
| 4882 | 4899 | |
| 4883 | 4900 | /* |
| 4884 | 4901 | ** CAPI3REF: User Data For Functions |
| 4885 | 4902 | ** METHOD: sqlite3_context |
| 4886 | 4903 | ** |
| @@ -4891,11 +4908,11 @@ | ||
| 4891 | 4908 | ** registered the application defined function. |
| 4892 | 4909 | ** |
| 4893 | 4910 | ** This routine must be called from the same thread in which |
| 4894 | 4911 | ** the application-defined function is running. |
| 4895 | 4912 | */ |
| 4896 | -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*); | |
| 4913 | +SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*); | |
| 4897 | 4914 | |
| 4898 | 4915 | /* |
| 4899 | 4916 | ** CAPI3REF: Database Connection For Functions |
| 4900 | 4917 | ** METHOD: sqlite3_context |
| 4901 | 4918 | ** |
| @@ -4903,11 +4920,11 @@ | ||
| 4903 | 4920 | ** the pointer to the [database connection] (the 1st parameter) |
| 4904 | 4921 | ** of the [sqlite3_create_function()] |
| 4905 | 4922 | ** and [sqlite3_create_function16()] routines that originally |
| 4906 | 4923 | ** registered the application defined function. |
| 4907 | 4924 | */ |
| 4908 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*); | |
| 4925 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*); | |
| 4909 | 4926 | |
| 4910 | 4927 | /* |
| 4911 | 4928 | ** CAPI3REF: Function Auxiliary Data |
| 4912 | 4929 | ** METHOD: sqlite3_context |
| 4913 | 4930 | ** |
| @@ -4956,12 +4973,12 @@ | ||
| 4956 | 4973 | ** values and [parameters] and expressions composed from the same.)^ |
| 4957 | 4974 | ** |
| 4958 | 4975 | ** These routines must be called from the same thread in which |
| 4959 | 4976 | ** the SQL function is running. |
| 4960 | 4977 | */ |
| 4961 | -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N); | |
| 4962 | -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); | |
| 4978 | +SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N); | |
| 4979 | +SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*)); | |
| 4963 | 4980 | |
| 4964 | 4981 | |
| 4965 | 4982 | /* |
| 4966 | 4983 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 4967 | 4984 | ** |
| @@ -4974,11 +4991,11 @@ | ||
| 4974 | 4991 | ** the content before returning. |
| 4975 | 4992 | ** |
| 4976 | 4993 | ** The typedef is necessary to work around problems in certain |
| 4977 | 4994 | ** C++ compilers. |
| 4978 | 4995 | */ |
| 4979 | -typedef void (*sqlite3_destructor_type)(void*); | |
| 4996 | +typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); | |
| 4980 | 4997 | #define SQLITE_STATIC ((sqlite3_destructor_type)0) |
| 4981 | 4998 | #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) |
| 4982 | 4999 | |
| 4983 | 5000 | /* |
| 4984 | 5001 | ** CAPI3REF: Setting The Result Of An SQL Function |
| @@ -5093,31 +5110,31 @@ | ||
| 5093 | 5110 | ** |
| 5094 | 5111 | ** If these routines are called from within the different thread |
| 5095 | 5112 | ** than the one containing the application-defined function that received |
| 5096 | 5113 | ** the [sqlite3_context] pointer, the results are undefined. |
| 5097 | 5114 | */ |
| 5098 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); | |
| 5099 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*, | |
| 5100 | - sqlite3_uint64,void(*)(void*)); | |
| 5101 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double); | |
| 5102 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int); | |
| 5103 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int); | |
| 5104 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*); | |
| 5105 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*); | |
| 5106 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int); | |
| 5107 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int); | |
| 5108 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); | |
| 5109 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*); | |
| 5110 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); | |
| 5111 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, | |
| 5112 | - void(*)(void*), unsigned char encoding); | |
| 5113 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); | |
| 5114 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); | |
| 5115 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); | |
| 5116 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); | |
| 5117 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); | |
| 5118 | -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); | |
| 5115 | +SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 5116 | +SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*, | |
| 5117 | + sqlite3_uint64,void(SQLITE_CALLBACK *)(void*)); | |
| 5118 | +SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double); | |
| 5119 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int); | |
| 5120 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int); | |
| 5121 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*); | |
| 5122 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*); | |
| 5123 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int); | |
| 5124 | +SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int); | |
| 5125 | +SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); | |
| 5126 | +SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*); | |
| 5127 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 5128 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, | |
| 5129 | + void(SQLITE_CALLBACK *)(void*), unsigned char encoding); | |
| 5130 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 5131 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); | |
| 5132 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); | |
| 5133 | +SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); | |
| 5134 | +SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n); | |
| 5135 | +SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); | |
| 5119 | 5136 | |
| 5120 | 5137 | |
| 5121 | 5138 | /* |
| 5122 | 5139 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 5123 | 5140 | ** METHOD: sqlite3_context |
| @@ -5128,11 +5145,11 @@ | ||
| 5128 | 5145 | ** of the subtype T are preserved in current versions of SQLite; |
| 5129 | 5146 | ** higher order bits are discarded. |
| 5130 | 5147 | ** The number of subtype bytes preserved by SQLite might increase |
| 5131 | 5148 | ** in future releases of SQLite. |
| 5132 | 5149 | */ |
| 5133 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int); | |
| 5150 | +SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int); | |
| 5134 | 5151 | |
| 5135 | 5152 | /* |
| 5136 | 5153 | ** CAPI3REF: Define New Collating Sequences |
| 5137 | 5154 | ** METHOD: sqlite3 |
| 5138 | 5155 | ** |
| @@ -5210,31 +5227,31 @@ | ||
| 5210 | 5227 | ** is unfortunate but cannot be changed without breaking backwards |
| 5211 | 5228 | ** compatibility. |
| 5212 | 5229 | ** |
| 5213 | 5230 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 5214 | 5231 | */ |
| 5215 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( | |
| 5232 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation( | |
| 5216 | 5233 | sqlite3*, |
| 5217 | 5234 | const char *zName, |
| 5218 | 5235 | int eTextRep, |
| 5219 | 5236 | void *pArg, |
| 5220 | - int(*xCompare)(void*,int,const void*,int,const void*) | |
| 5237 | + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) | |
| 5221 | 5238 | ); |
| 5222 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( | |
| 5239 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2( | |
| 5223 | 5240 | sqlite3*, |
| 5224 | 5241 | const char *zName, |
| 5225 | 5242 | int eTextRep, |
| 5226 | 5243 | void *pArg, |
| 5227 | - int(*xCompare)(void*,int,const void*,int,const void*), | |
| 5228 | - void(*xDestroy)(void*) | |
| 5244 | + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*), | |
| 5245 | + void(SQLITE_CALLBACK *xDestroy)(void*) | |
| 5229 | 5246 | ); |
| 5230 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( | |
| 5247 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation16( | |
| 5231 | 5248 | sqlite3*, |
| 5232 | 5249 | const void *zName, |
| 5233 | 5250 | int eTextRep, |
| 5234 | 5251 | void *pArg, |
| 5235 | - int(*xCompare)(void*,int,const void*,int,const void*) | |
| 5252 | + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) | |
| 5236 | 5253 | ); |
| 5237 | 5254 | |
| 5238 | 5255 | /* |
| 5239 | 5256 | ** CAPI3REF: Collation Needed Callbacks |
| 5240 | 5257 | ** METHOD: sqlite3 |
| @@ -5260,19 +5277,19 @@ | ||
| 5260 | 5277 | ** |
| 5261 | 5278 | ** The callback function should register the desired collation using |
| 5262 | 5279 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5263 | 5280 | ** [sqlite3_create_collation_v2()]. |
| 5264 | 5281 | */ |
| 5265 | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( | |
| 5282 | +SQLITE_API int SQLITE_APICALL sqlite3_collation_needed( | |
| 5266 | 5283 | sqlite3*, |
| 5267 | 5284 | void*, |
| 5268 | - void(*)(void*,sqlite3*,int eTextRep,const char*) | |
| 5285 | + void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*) | |
| 5269 | 5286 | ); |
| 5270 | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( | |
| 5287 | +SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16( | |
| 5271 | 5288 | sqlite3*, |
| 5272 | 5289 | void*, |
| 5273 | - void(*)(void*,sqlite3*,int eTextRep,const void*) | |
| 5290 | + void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*) | |
| 5274 | 5291 | ); |
| 5275 | 5292 | |
| 5276 | 5293 | #ifdef SQLITE_HAS_CODEC |
| 5277 | 5294 | /* |
| 5278 | 5295 | ** Specify the key for an encrypted database. This routine should be |
| @@ -5279,15 +5296,15 @@ | ||
| 5279 | 5296 | ** called right after sqlite3_open(). |
| 5280 | 5297 | ** |
| 5281 | 5298 | ** The code to implement this API is not available in the public release |
| 5282 | 5299 | ** of SQLite. |
| 5283 | 5300 | */ |
| 5284 | -SQLITE_API int SQLITE_STDCALL sqlite3_key( | |
| 5301 | +SQLITE_API int SQLITE_APICALL sqlite3_key( | |
| 5285 | 5302 | sqlite3 *db, /* Database to be rekeyed */ |
| 5286 | 5303 | const void *pKey, int nKey /* The key */ |
| 5287 | 5304 | ); |
| 5288 | -SQLITE_API int SQLITE_STDCALL sqlite3_key_v2( | |
| 5305 | +SQLITE_API int SQLITE_APICALL sqlite3_key_v2( | |
| 5289 | 5306 | sqlite3 *db, /* Database to be rekeyed */ |
| 5290 | 5307 | const char *zDbName, /* Name of the database */ |
| 5291 | 5308 | const void *pKey, int nKey /* The key */ |
| 5292 | 5309 | ); |
| 5293 | 5310 | |
| @@ -5297,35 +5314,35 @@ | ||
| 5297 | 5314 | ** database is decrypted. |
| 5298 | 5315 | ** |
| 5299 | 5316 | ** The code to implement this API is not available in the public release |
| 5300 | 5317 | ** of SQLite. |
| 5301 | 5318 | */ |
| 5302 | -SQLITE_API int SQLITE_STDCALL sqlite3_rekey( | |
| 5319 | +SQLITE_API int SQLITE_APICALL sqlite3_rekey( | |
| 5303 | 5320 | sqlite3 *db, /* Database to be rekeyed */ |
| 5304 | 5321 | const void *pKey, int nKey /* The new key */ |
| 5305 | 5322 | ); |
| 5306 | -SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2( | |
| 5323 | +SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2( | |
| 5307 | 5324 | sqlite3 *db, /* Database to be rekeyed */ |
| 5308 | 5325 | const char *zDbName, /* Name of the database */ |
| 5309 | 5326 | const void *pKey, int nKey /* The new key */ |
| 5310 | 5327 | ); |
| 5311 | 5328 | |
| 5312 | 5329 | /* |
| 5313 | 5330 | ** Specify the activation key for a SEE database. Unless |
| 5314 | 5331 | ** activated, none of the SEE routines will work. |
| 5315 | 5332 | */ |
| 5316 | -SQLITE_API void SQLITE_STDCALL sqlite3_activate_see( | |
| 5333 | +SQLITE_API void SQLITE_APICALL sqlite3_activate_see( | |
| 5317 | 5334 | const char *zPassPhrase /* Activation phrase */ |
| 5318 | 5335 | ); |
| 5319 | 5336 | #endif |
| 5320 | 5337 | |
| 5321 | 5338 | #ifdef SQLITE_ENABLE_CEROD |
| 5322 | 5339 | /* |
| 5323 | 5340 | ** Specify the activation key for a CEROD database. Unless |
| 5324 | 5341 | ** activated, none of the CEROD routines will work. |
| 5325 | 5342 | */ |
| 5326 | -SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod( | |
| 5343 | +SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod( | |
| 5327 | 5344 | const char *zPassPhrase /* Activation phrase */ |
| 5328 | 5345 | ); |
| 5329 | 5346 | #endif |
| 5330 | 5347 | |
| 5331 | 5348 | /* |
| @@ -5343,11 +5360,11 @@ | ||
| 5343 | 5360 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5344 | 5361 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5345 | 5362 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5346 | 5363 | ** in the previous paragraphs. |
| 5347 | 5364 | */ |
| 5348 | -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int); | |
| 5365 | +SQLITE_API int SQLITE_APICALL sqlite3_sleep(int); | |
| 5349 | 5366 | |
| 5350 | 5367 | /* |
| 5351 | 5368 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5352 | 5369 | ** |
| 5353 | 5370 | ** ^(If this global variable is made to point to a string which is |
| @@ -5462,11 +5479,11 @@ | ||
| 5462 | 5479 | ** |
| 5463 | 5480 | ** If another thread changes the autocommit status of the database |
| 5464 | 5481 | ** connection while this routine is running, then the return value |
| 5465 | 5482 | ** is undefined. |
| 5466 | 5483 | */ |
| 5467 | -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*); | |
| 5484 | +SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*); | |
| 5468 | 5485 | |
| 5469 | 5486 | /* |
| 5470 | 5487 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5471 | 5488 | ** METHOD: sqlite3_stmt |
| 5472 | 5489 | ** |
| @@ -5475,11 +5492,11 @@ | ||
| 5475 | 5492 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5476 | 5493 | ** that was the first argument |
| 5477 | 5494 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5478 | 5495 | ** create the statement in the first place. |
| 5479 | 5496 | */ |
| 5480 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*); | |
| 5497 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*); | |
| 5481 | 5498 | |
| 5482 | 5499 | /* |
| 5483 | 5500 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5484 | 5501 | ** METHOD: sqlite3 |
| 5485 | 5502 | ** |
| @@ -5492,21 +5509,21 @@ | ||
| 5492 | 5509 | ** ^The filename returned by this function is the output of the |
| 5493 | 5510 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5494 | 5511 | ** will be an absolute pathname, even if the filename used |
| 5495 | 5512 | ** to open the database originally was a URI or relative pathname. |
| 5496 | 5513 | */ |
| 5497 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); | |
| 5514 | +SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); | |
| 5498 | 5515 | |
| 5499 | 5516 | /* |
| 5500 | 5517 | ** CAPI3REF: Determine if a database is read-only |
| 5501 | 5518 | ** METHOD: sqlite3 |
| 5502 | 5519 | ** |
| 5503 | 5520 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5504 | 5521 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5505 | 5522 | ** the name of a database on connection D. |
| 5506 | 5523 | */ |
| 5507 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); | |
| 5524 | +SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); | |
| 5508 | 5525 | |
| 5509 | 5526 | /* |
| 5510 | 5527 | ** CAPI3REF: Find the next prepared statement |
| 5511 | 5528 | ** METHOD: sqlite3 |
| 5512 | 5529 | ** |
| @@ -5518,11 +5535,11 @@ | ||
| 5518 | 5535 | ** |
| 5519 | 5536 | ** The [database connection] pointer D in a call to |
| 5520 | 5537 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5521 | 5538 | ** connection and in particular must not be a NULL pointer. |
| 5522 | 5539 | */ |
| 5523 | -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); | |
| 5540 | +SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); | |
| 5524 | 5541 | |
| 5525 | 5542 | /* |
| 5526 | 5543 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5527 | 5544 | ** METHOD: sqlite3 |
| 5528 | 5545 | ** |
| @@ -5567,12 +5584,12 @@ | ||
| 5567 | 5584 | ** ^The rollback callback is not invoked if a transaction is |
| 5568 | 5585 | ** automatically rolled back because the database connection is closed. |
| 5569 | 5586 | ** |
| 5570 | 5587 | ** See also the [sqlite3_update_hook()] interface. |
| 5571 | 5588 | */ |
| 5572 | -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); | |
| 5573 | -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); | |
| 5589 | +SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*); | |
| 5590 | +SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); | |
| 5574 | 5591 | |
| 5575 | 5592 | /* |
| 5576 | 5593 | ** CAPI3REF: Data Change Notification Callbacks |
| 5577 | 5594 | ** METHOD: sqlite3 |
| 5578 | 5595 | ** |
| @@ -5619,13 +5636,13 @@ | ||
| 5619 | 5636 | ** the first call on D. |
| 5620 | 5637 | ** |
| 5621 | 5638 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5622 | 5639 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5623 | 5640 | */ |
| 5624 | -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( | |
| 5641 | +SQLITE_API void *SQLITE_APICALL sqlite3_update_hook( | |
| 5625 | 5642 | sqlite3*, |
| 5626 | - void(*)(void *,int ,char const *,char const *,sqlite3_int64), | |
| 5643 | + void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64), | |
| 5627 | 5644 | void* |
| 5628 | 5645 | ); |
| 5629 | 5646 | |
| 5630 | 5647 | /* |
| 5631 | 5648 | ** CAPI3REF: Enable Or Disable Shared Pager Cache |
| @@ -5659,11 +5676,11 @@ | ||
| 5659 | 5676 | ** This interface is threadsafe on processors where writing a |
| 5660 | 5677 | ** 32-bit integer is atomic. |
| 5661 | 5678 | ** |
| 5662 | 5679 | ** See Also: [SQLite Shared-Cache Mode] |
| 5663 | 5680 | */ |
| 5664 | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int); | |
| 5681 | +SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int); | |
| 5665 | 5682 | |
| 5666 | 5683 | /* |
| 5667 | 5684 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5668 | 5685 | ** |
| 5669 | 5686 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| @@ -5675,11 +5692,11 @@ | ||
| 5675 | 5692 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5676 | 5693 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5677 | 5694 | ** |
| 5678 | 5695 | ** See also: [sqlite3_db_release_memory()] |
| 5679 | 5696 | */ |
| 5680 | -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int); | |
| 5697 | +SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int); | |
| 5681 | 5698 | |
| 5682 | 5699 | /* |
| 5683 | 5700 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5684 | 5701 | ** METHOD: sqlite3 |
| 5685 | 5702 | ** |
| @@ -5689,11 +5706,11 @@ | ||
| 5689 | 5706 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5690 | 5707 | ** omitted. |
| 5691 | 5708 | ** |
| 5692 | 5709 | ** See also: [sqlite3_release_memory()] |
| 5693 | 5710 | */ |
| 5694 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*); | |
| 5711 | +SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*); | |
| 5695 | 5712 | |
| 5696 | 5713 | /* |
| 5697 | 5714 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5698 | 5715 | ** |
| 5699 | 5716 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| @@ -5741,11 +5758,11 @@ | ||
| 5741 | 5758 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5742 | 5759 | ** |
| 5743 | 5760 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5744 | 5761 | ** changes in future releases of SQLite. |
| 5745 | 5762 | */ |
| 5746 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N); | |
| 5763 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N); | |
| 5747 | 5764 | |
| 5748 | 5765 | /* |
| 5749 | 5766 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5750 | 5767 | ** DEPRECATED |
| 5751 | 5768 | ** |
| @@ -5752,11 +5769,11 @@ | ||
| 5752 | 5769 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5753 | 5770 | ** interface. This routine is provided for historical compatibility |
| 5754 | 5771 | ** only. All new applications should use the |
| 5755 | 5772 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5756 | 5773 | */ |
| 5757 | -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N); | |
| 5774 | +SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N); | |
| 5758 | 5775 | |
| 5759 | 5776 | |
| 5760 | 5777 | /* |
| 5761 | 5778 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5762 | 5779 | ** METHOD: sqlite3 |
| @@ -5822,11 +5839,11 @@ | ||
| 5822 | 5839 | ** |
| 5823 | 5840 | ** ^This function causes all database schemas to be read from disk and |
| 5824 | 5841 | ** parsed, if that has not already been done, and returns an error if |
| 5825 | 5842 | ** any errors are encountered while loading the schema. |
| 5826 | 5843 | */ |
| 5827 | -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( | |
| 5844 | +SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata( | |
| 5828 | 5845 | sqlite3 *db, /* Connection handle */ |
| 5829 | 5846 | const char *zDbName, /* Database name or NULL */ |
| 5830 | 5847 | const char *zTableName, /* Table name */ |
| 5831 | 5848 | const char *zColumnName, /* Column name */ |
| 5832 | 5849 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -5878,11 +5895,11 @@ | ||
| 5878 | 5895 | ** disabled and prevent SQL injections from giving attackers |
| 5879 | 5896 | ** access to extension loading capabilities. |
| 5880 | 5897 | ** |
| 5881 | 5898 | ** See also the [load_extension() SQL function]. |
| 5882 | 5899 | */ |
| 5883 | -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( | |
| 5900 | +SQLITE_API int SQLITE_APICALL sqlite3_load_extension( | |
| 5884 | 5901 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5885 | 5902 | const char *zFile, /* Name of the shared library containing extension */ |
| 5886 | 5903 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5887 | 5904 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5888 | 5905 | ); |
| @@ -5910,11 +5927,11 @@ | ||
| 5910 | 5927 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5911 | 5928 | ** rather than this interface, so the [load_extension()] SQL function |
| 5912 | 5929 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5913 | 5930 | ** access to extension loading capabilities. |
| 5914 | 5931 | */ |
| 5915 | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); | |
| 5932 | +SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); | |
| 5916 | 5933 | |
| 5917 | 5934 | /* |
| 5918 | 5935 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5919 | 5936 | ** |
| 5920 | 5937 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| @@ -5948,11 +5965,14 @@ | ||
| 5948 | 5965 | ** will be called more than once for each database connection that is opened. |
| 5949 | 5966 | ** |
| 5950 | 5967 | ** See also: [sqlite3_reset_auto_extension()] |
| 5951 | 5968 | ** and [sqlite3_cancel_auto_extension()] |
| 5952 | 5969 | */ |
| 5953 | -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void)); | |
| 5970 | +typedef struct sqlite3_api_routines sqlite3_api_routines; | |
| 5971 | +SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( | |
| 5972 | + int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) | |
| 5973 | +); | |
| 5954 | 5974 | |
| 5955 | 5975 | /* |
| 5956 | 5976 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5957 | 5977 | ** |
| 5958 | 5978 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| @@ -5960,19 +5980,21 @@ | ||
| 5960 | 5980 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5961 | 5981 | ** routine returns 1 if initialization routine X was successfully |
| 5962 | 5982 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5963 | 5983 | ** routines. |
| 5964 | 5984 | */ |
| 5965 | -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); | |
| 5985 | +SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( | |
| 5986 | + int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) | |
| 5987 | +); | |
| 5966 | 5988 | |
| 5967 | 5989 | /* |
| 5968 | 5990 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5969 | 5991 | ** |
| 5970 | 5992 | ** ^This interface disables all automatic extensions previously |
| 5971 | 5993 | ** registered using [sqlite3_auto_extension()]. |
| 5972 | 5994 | */ |
| 5973 | -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void); | |
| 5995 | +SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void); | |
| 5974 | 5996 | |
| 5975 | 5997 | /* |
| 5976 | 5998 | ** The interface to the virtual-table mechanism is currently considered |
| 5977 | 5999 | ** to be experimental. The interface might change in incompatible ways. |
| 5978 | 6000 | ** If this is a problem for you, do not use the interface at this time. |
| @@ -6005,41 +6027,41 @@ | ||
| 6005 | 6027 | ** of this structure must not change while it is registered with |
| 6006 | 6028 | ** any database connection. |
| 6007 | 6029 | */ |
| 6008 | 6030 | struct sqlite3_module { |
| 6009 | 6031 | int iVersion; |
| 6010 | - int (*xCreate)(sqlite3*, void *pAux, | |
| 6011 | - int argc, const char *const*argv, | |
| 6012 | - sqlite3_vtab **ppVTab, char**); | |
| 6013 | - int (*xConnect)(sqlite3*, void *pAux, | |
| 6014 | - int argc, const char *const*argv, | |
| 6015 | - sqlite3_vtab **ppVTab, char**); | |
| 6016 | - int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); | |
| 6017 | - int (*xDisconnect)(sqlite3_vtab *pVTab); | |
| 6018 | - int (*xDestroy)(sqlite3_vtab *pVTab); | |
| 6019 | - int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); | |
| 6020 | - int (*xClose)(sqlite3_vtab_cursor*); | |
| 6021 | - int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, | |
| 6022 | - int argc, sqlite3_value **argv); | |
| 6023 | - int (*xNext)(sqlite3_vtab_cursor*); | |
| 6024 | - int (*xEof)(sqlite3_vtab_cursor*); | |
| 6025 | - int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); | |
| 6026 | - int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); | |
| 6027 | - int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); | |
| 6028 | - int (*xBegin)(sqlite3_vtab *pVTab); | |
| 6029 | - int (*xSync)(sqlite3_vtab *pVTab); | |
| 6030 | - int (*xCommit)(sqlite3_vtab *pVTab); | |
| 6031 | - int (*xRollback)(sqlite3_vtab *pVTab); | |
| 6032 | - int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, | |
| 6033 | - void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 6034 | - void **ppArg); | |
| 6035 | - int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); | |
| 6036 | - /* The methods above are in version 1 of the sqlite_module object. Those | |
| 6037 | - ** below are for version 2 and greater. */ | |
| 6038 | - int (*xSavepoint)(sqlite3_vtab *pVTab, int); | |
| 6039 | - int (*xRelease)(sqlite3_vtab *pVTab, int); | |
| 6040 | - int (*xRollbackTo)(sqlite3_vtab *pVTab, int); | |
| 6032 | + int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux, | |
| 6033 | + int argc, const char *const*argv, | |
| 6034 | + sqlite3_vtab **ppVTab, char**); | |
| 6035 | + int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux, | |
| 6036 | + int argc, const char *const*argv, | |
| 6037 | + sqlite3_vtab **ppVTab, char**); | |
| 6038 | + int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); | |
| 6039 | + int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab); | |
| 6040 | + int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab); | |
| 6041 | + int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); | |
| 6042 | + int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*); | |
| 6043 | + int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, | |
| 6044 | + int argc, sqlite3_value **argv); | |
| 6045 | + int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*); | |
| 6046 | + int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*); | |
| 6047 | + int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); | |
| 6048 | + int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); | |
| 6049 | + int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); | |
| 6050 | + int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab); | |
| 6051 | + int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab); | |
| 6052 | + int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab); | |
| 6053 | + int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab); | |
| 6054 | + int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, | |
| 6055 | + void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 6056 | + void **ppArg); | |
| 6057 | + int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew); | |
| 6058 | + /* The methods above are in version 1 of the sqlite_module object. Those | |
| 6059 | + ** below are for version 2 and greater. */ | |
| 6060 | + int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int); | |
| 6061 | + int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int); | |
| 6062 | + int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int); | |
| 6041 | 6063 | }; |
| 6042 | 6064 | |
| 6043 | 6065 | /* |
| 6044 | 6066 | ** CAPI3REF: Virtual Table Indexing Information |
| 6045 | 6067 | ** KEYWORDS: sqlite3_index_info |
| @@ -6213,22 +6235,22 @@ | ||
| 6213 | 6235 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 6214 | 6236 | ** ^The sqlite3_create_module() |
| 6215 | 6237 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 6216 | 6238 | ** destructor. |
| 6217 | 6239 | */ |
| 6218 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module( | |
| 6240 | +SQLITE_API int SQLITE_APICALL sqlite3_create_module( | |
| 6219 | 6241 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6220 | 6242 | const char *zName, /* Name of the module */ |
| 6221 | 6243 | const sqlite3_module *p, /* Methods for the module */ |
| 6222 | 6244 | void *pClientData /* Client data for xCreate/xConnect */ |
| 6223 | 6245 | ); |
| 6224 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( | |
| 6246 | +SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2( | |
| 6225 | 6247 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6226 | 6248 | const char *zName, /* Name of the module */ |
| 6227 | 6249 | const sqlite3_module *p, /* Methods for the module */ |
| 6228 | 6250 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 6229 | - void(*xDestroy)(void*) /* Module destructor function */ | |
| 6251 | + void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */ | |
| 6230 | 6252 | ); |
| 6231 | 6253 | |
| 6232 | 6254 | /* |
| 6233 | 6255 | ** CAPI3REF: Virtual Table Instance Object |
| 6234 | 6256 | ** KEYWORDS: sqlite3_vtab |
| @@ -6282,11 +6304,11 @@ | ||
| 6282 | 6304 | ** ^The [xCreate] and [xConnect] methods of a |
| 6283 | 6305 | ** [virtual table module] call this interface |
| 6284 | 6306 | ** to declare the format (the names and datatypes of the columns) of |
| 6285 | 6307 | ** the virtual tables they implement. |
| 6286 | 6308 | */ |
| 6287 | -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); | |
| 6309 | +SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); | |
| 6288 | 6310 | |
| 6289 | 6311 | /* |
| 6290 | 6312 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6291 | 6313 | ** METHOD: sqlite3 |
| 6292 | 6314 | ** |
| @@ -6301,11 +6323,11 @@ | ||
| 6301 | 6323 | ** of the new function always causes an exception to be thrown. So |
| 6302 | 6324 | ** the new function is not good for anything by itself. Its only |
| 6303 | 6325 | ** purpose is to be a placeholder function that can be overloaded |
| 6304 | 6326 | ** by a [virtual table]. |
| 6305 | 6327 | */ |
| 6306 | -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); | |
| 6328 | +SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); | |
| 6307 | 6329 | |
| 6308 | 6330 | /* |
| 6309 | 6331 | ** The interface to the virtual-table mechanism defined above (back up |
| 6310 | 6332 | ** to a comment remarkably similar to this one) is currently considered |
| 6311 | 6333 | ** to be experimental. The interface might change in incompatible ways. |
| @@ -6400,11 +6422,11 @@ | ||
| 6400 | 6422 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6401 | 6423 | ** |
| 6402 | 6424 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6403 | 6425 | ** be released by a call to [sqlite3_blob_close()]. |
| 6404 | 6426 | */ |
| 6405 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( | |
| 6427 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_open( | |
| 6406 | 6428 | sqlite3*, |
| 6407 | 6429 | const char *zDb, |
| 6408 | 6430 | const char *zTable, |
| 6409 | 6431 | const char *zColumn, |
| 6410 | 6432 | sqlite3_int64 iRow, |
| @@ -6433,11 +6455,11 @@ | ||
| 6433 | 6455 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6434 | 6456 | ** always returns zero. |
| 6435 | 6457 | ** |
| 6436 | 6458 | ** ^This function sets the database handle error code and message. |
| 6437 | 6459 | */ |
| 6438 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); | |
| 6460 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); | |
| 6439 | 6461 | |
| 6440 | 6462 | /* |
| 6441 | 6463 | ** CAPI3REF: Close A BLOB Handle |
| 6442 | 6464 | ** DESTRUCTOR: sqlite3_blob |
| 6443 | 6465 | ** |
| @@ -6456,11 +6478,11 @@ | ||
| 6456 | 6478 | ** with a null pointer (such as would be returned by a failed call to |
| 6457 | 6479 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6458 | 6480 | ** is passed a valid open blob handle, the values returned by the |
| 6459 | 6481 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6460 | 6482 | */ |
| 6461 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *); | |
| 6483 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *); | |
| 6462 | 6484 | |
| 6463 | 6485 | /* |
| 6464 | 6486 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6465 | 6487 | ** METHOD: sqlite3_blob |
| 6466 | 6488 | ** |
| @@ -6472,11 +6494,11 @@ | ||
| 6472 | 6494 | ** This routine only works on a [BLOB handle] which has been created |
| 6473 | 6495 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6474 | 6496 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6475 | 6497 | ** to this routine results in undefined and probably undesirable behavior. |
| 6476 | 6498 | */ |
| 6477 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *); | |
| 6499 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *); | |
| 6478 | 6500 | |
| 6479 | 6501 | /* |
| 6480 | 6502 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6481 | 6503 | ** METHOD: sqlite3_blob |
| 6482 | 6504 | ** |
| @@ -6501,11 +6523,11 @@ | ||
| 6501 | 6523 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6502 | 6524 | ** to this routine results in undefined and probably undesirable behavior. |
| 6503 | 6525 | ** |
| 6504 | 6526 | ** See also: [sqlite3_blob_write()]. |
| 6505 | 6527 | */ |
| 6506 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); | |
| 6528 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); | |
| 6507 | 6529 | |
| 6508 | 6530 | /* |
| 6509 | 6531 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6510 | 6532 | ** METHOD: sqlite3_blob |
| 6511 | 6533 | ** |
| @@ -6543,11 +6565,11 @@ | ||
| 6543 | 6565 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6544 | 6566 | ** to this routine results in undefined and probably undesirable behavior. |
| 6545 | 6567 | ** |
| 6546 | 6568 | ** See also: [sqlite3_blob_read()]. |
| 6547 | 6569 | */ |
| 6548 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); | |
| 6570 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); | |
| 6549 | 6571 | |
| 6550 | 6572 | /* |
| 6551 | 6573 | ** CAPI3REF: Virtual File System Objects |
| 6552 | 6574 | ** |
| 6553 | 6575 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| @@ -6574,13 +6596,13 @@ | ||
| 6574 | 6596 | ** |
| 6575 | 6597 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6576 | 6598 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6577 | 6599 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6578 | 6600 | */ |
| 6579 | -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName); | |
| 6580 | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); | |
| 6581 | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*); | |
| 6601 | +SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName); | |
| 6602 | +SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); | |
| 6603 | +SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*); | |
| 6582 | 6604 | |
| 6583 | 6605 | /* |
| 6584 | 6606 | ** CAPI3REF: Mutexes |
| 6585 | 6607 | ** |
| 6586 | 6608 | ** The SQLite core uses these routines for thread |
| @@ -6692,15 +6714,15 @@ | ||
| 6692 | 6714 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6693 | 6715 | ** behave as no-ops. |
| 6694 | 6716 | ** |
| 6695 | 6717 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6696 | 6718 | */ |
| 6697 | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); | |
| 6698 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); | |
| 6699 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); | |
| 6700 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); | |
| 6701 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*); | |
| 6719 | +SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int); | |
| 6720 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*); | |
| 6721 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*); | |
| 6722 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*); | |
| 6723 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*); | |
| 6702 | 6724 | |
| 6703 | 6725 | /* |
| 6704 | 6726 | ** CAPI3REF: Mutex Methods Object |
| 6705 | 6727 | ** |
| 6706 | 6728 | ** An instance of this structure defines the low-level routines |
| @@ -6765,19 +6787,19 @@ | ||
| 6765 | 6787 | ** If xMutexInit fails in any way, it is expected to clean up after itself |
| 6766 | 6788 | ** prior to returning. |
| 6767 | 6789 | */ |
| 6768 | 6790 | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; |
| 6769 | 6791 | struct sqlite3_mutex_methods { |
| 6770 | - int (*xMutexInit)(void); | |
| 6771 | - int (*xMutexEnd)(void); | |
| 6772 | - sqlite3_mutex *(*xMutexAlloc)(int); | |
| 6773 | - void (*xMutexFree)(sqlite3_mutex *); | |
| 6774 | - void (*xMutexEnter)(sqlite3_mutex *); | |
| 6775 | - int (*xMutexTry)(sqlite3_mutex *); | |
| 6776 | - void (*xMutexLeave)(sqlite3_mutex *); | |
| 6777 | - int (*xMutexHeld)(sqlite3_mutex *); | |
| 6778 | - int (*xMutexNotheld)(sqlite3_mutex *); | |
| 6792 | + int (SQLITE_CALLBACK *xMutexInit)(void); | |
| 6793 | + int (SQLITE_CALLBACK *xMutexEnd)(void); | |
| 6794 | + sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int); | |
| 6795 | + void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *); | |
| 6796 | + void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *); | |
| 6797 | + int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *); | |
| 6798 | + void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *); | |
| 6799 | + int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *); | |
| 6800 | + int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *); | |
| 6779 | 6801 | }; |
| 6780 | 6802 | |
| 6781 | 6803 | /* |
| 6782 | 6804 | ** CAPI3REF: Mutex Verification Routines |
| 6783 | 6805 | ** |
| @@ -6806,12 +6828,12 @@ | ||
| 6806 | 6828 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6807 | 6829 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6808 | 6830 | ** interface should also return 1 when given a NULL pointer. |
| 6809 | 6831 | */ |
| 6810 | 6832 | #ifndef NDEBUG |
| 6811 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*); | |
| 6812 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*); | |
| 6833 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*); | |
| 6834 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*); | |
| 6813 | 6835 | #endif |
| 6814 | 6836 | |
| 6815 | 6837 | /* |
| 6816 | 6838 | ** CAPI3REF: Mutex Types |
| 6817 | 6839 | ** |
| @@ -6847,11 +6869,11 @@ | ||
| 6847 | 6869 | ** serializes access to the [database connection] given in the argument |
| 6848 | 6870 | ** when the [threading mode] is Serialized. |
| 6849 | 6871 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6850 | 6872 | ** routine returns a NULL pointer. |
| 6851 | 6873 | */ |
| 6852 | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*); | |
| 6874 | +SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*); | |
| 6853 | 6875 | |
| 6854 | 6876 | /* |
| 6855 | 6877 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6856 | 6878 | ** METHOD: sqlite3 |
| 6857 | 6879 | ** |
| @@ -6882,11 +6904,11 @@ | ||
| 6882 | 6904 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6883 | 6905 | ** xFileControl method. |
| 6884 | 6906 | ** |
| 6885 | 6907 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6886 | 6908 | */ |
| 6887 | -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); | |
| 6909 | +SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); | |
| 6888 | 6910 | |
| 6889 | 6911 | /* |
| 6890 | 6912 | ** CAPI3REF: Testing Interface |
| 6891 | 6913 | ** |
| 6892 | 6914 | ** ^The sqlite3_test_control() interface is used to read out internal |
| @@ -6964,12 +6986,12 @@ | ||
| 6964 | 6986 | ** be represented by a 32-bit integer, then the values returned by |
| 6965 | 6987 | ** sqlite3_status() are undefined. |
| 6966 | 6988 | ** |
| 6967 | 6989 | ** See also: [sqlite3_db_status()] |
| 6968 | 6990 | */ |
| 6969 | -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); | |
| 6970 | -SQLITE_API int SQLITE_STDCALL sqlite3_status64( | |
| 6991 | +SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); | |
| 6992 | +SQLITE_API int SQLITE_APICALL sqlite3_status64( | |
| 6971 | 6993 | int op, |
| 6972 | 6994 | sqlite3_int64 *pCurrent, |
| 6973 | 6995 | sqlite3_int64 *pHighwater, |
| 6974 | 6996 | int resetFlag |
| 6975 | 6997 | ); |
| @@ -7090,11 +7112,11 @@ | ||
| 7090 | 7112 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 7091 | 7113 | ** non-zero [error code] on failure. |
| 7092 | 7114 | ** |
| 7093 | 7115 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 7094 | 7116 | */ |
| 7095 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); | |
| 7117 | +SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); | |
| 7096 | 7118 | |
| 7097 | 7119 | /* |
| 7098 | 7120 | ** CAPI3REF: Status Parameters for database connections |
| 7099 | 7121 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 7100 | 7122 | ** |
| @@ -7233,11 +7255,11 @@ | ||
| 7233 | 7255 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 7234 | 7256 | ** interface call returns. |
| 7235 | 7257 | ** |
| 7236 | 7258 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 7237 | 7259 | */ |
| 7238 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); | |
| 7260 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); | |
| 7239 | 7261 | |
| 7240 | 7262 | /* |
| 7241 | 7263 | ** CAPI3REF: Status Parameters for prepared statements |
| 7242 | 7264 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 7243 | 7265 | ** |
| @@ -7469,22 +7491,22 @@ | ||
| 7469 | 7491 | */ |
| 7470 | 7492 | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; |
| 7471 | 7493 | struct sqlite3_pcache_methods2 { |
| 7472 | 7494 | int iVersion; |
| 7473 | 7495 | void *pArg; |
| 7474 | - int (*xInit)(void*); | |
| 7475 | - void (*xShutdown)(void*); | |
| 7476 | - sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); | |
| 7477 | - void (*xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7478 | - int (*xPagecount)(sqlite3_pcache*); | |
| 7479 | - sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7480 | - void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); | |
| 7481 | - void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, | |
| 7496 | + int (SQLITE_CALLBACK *xInit)(void*); | |
| 7497 | + void (SQLITE_CALLBACK *xShutdown)(void*); | |
| 7498 | + sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable); | |
| 7499 | + void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7500 | + int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); | |
| 7501 | + sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7502 | + void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); | |
| 7503 | + void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, | |
| 7482 | 7504 | unsigned oldKey, unsigned newKey); |
| 7483 | - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7484 | - void (*xDestroy)(sqlite3_pcache*); | |
| 7485 | - void (*xShrink)(sqlite3_pcache*); | |
| 7505 | + void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7506 | + void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); | |
| 7507 | + void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*); | |
| 7486 | 7508 | }; |
| 7487 | 7509 | |
| 7488 | 7510 | /* |
| 7489 | 7511 | ** This is the obsolete pcache_methods object that has now been replaced |
| 7490 | 7512 | ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is |
| @@ -7491,20 +7513,20 @@ | ||
| 7491 | 7513 | ** retained in the header file for backwards compatibility only. |
| 7492 | 7514 | */ |
| 7493 | 7515 | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; |
| 7494 | 7516 | struct sqlite3_pcache_methods { |
| 7495 | 7517 | void *pArg; |
| 7496 | - int (*xInit)(void*); | |
| 7497 | - void (*xShutdown)(void*); | |
| 7498 | - sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); | |
| 7499 | - void (*xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7500 | - int (*xPagecount)(sqlite3_pcache*); | |
| 7501 | - void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7502 | - void (*xUnpin)(sqlite3_pcache*, void*, int discard); | |
| 7503 | - void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); | |
| 7504 | - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7505 | - void (*xDestroy)(sqlite3_pcache*); | |
| 7518 | + int (SQLITE_CALLBACK *xInit)(void*); | |
| 7519 | + void (SQLITE_CALLBACK *xShutdown)(void*); | |
| 7520 | + sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable); | |
| 7521 | + void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7522 | + int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); | |
| 7523 | + void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7524 | + void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard); | |
| 7525 | + void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); | |
| 7526 | + void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7527 | + void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); | |
| 7506 | 7528 | }; |
| 7507 | 7529 | |
| 7508 | 7530 | |
| 7509 | 7531 | /* |
| 7510 | 7532 | ** CAPI3REF: Online Backup Object |
| @@ -7702,20 +7724,20 @@ | ||
| 7702 | 7724 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7703 | 7725 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7704 | 7726 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7705 | 7727 | ** possible that they return invalid values. |
| 7706 | 7728 | */ |
| 7707 | -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( | |
| 7729 | +SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init( | |
| 7708 | 7730 | sqlite3 *pDest, /* Destination database handle */ |
| 7709 | 7731 | const char *zDestName, /* Destination database name */ |
| 7710 | 7732 | sqlite3 *pSource, /* Source database handle */ |
| 7711 | 7733 | const char *zSourceName /* Source database name */ |
| 7712 | 7734 | ); |
| 7713 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage); | |
| 7714 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p); | |
| 7715 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p); | |
| 7716 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p); | |
| 7735 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage); | |
| 7736 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p); | |
| 7737 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p); | |
| 7738 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p); | |
| 7717 | 7739 | |
| 7718 | 7740 | /* |
| 7719 | 7741 | ** CAPI3REF: Unlock Notification |
| 7720 | 7742 | ** METHOD: sqlite3 |
| 7721 | 7743 | ** |
| @@ -7828,13 +7850,13 @@ | ||
| 7828 | 7850 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7829 | 7851 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7830 | 7852 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7831 | 7853 | ** SQLITE_LOCKED.)^ |
| 7832 | 7854 | */ |
| 7833 | -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( | |
| 7855 | +SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify( | |
| 7834 | 7856 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7835 | - void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ | |
| 7857 | + void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */ | |
| 7836 | 7858 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7837 | 7859 | ); |
| 7838 | 7860 | |
| 7839 | 7861 | |
| 7840 | 7862 | /* |
| @@ -7843,12 +7865,12 @@ | ||
| 7843 | 7865 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7844 | 7866 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7845 | 7867 | ** strings in a case-independent fashion, using the same definition of "case |
| 7846 | 7868 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7847 | 7869 | */ |
| 7848 | -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *); | |
| 7849 | -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int); | |
| 7870 | +SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *); | |
| 7871 | +SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int); | |
| 7850 | 7872 | |
| 7851 | 7873 | /* |
| 7852 | 7874 | ** CAPI3REF: String Globbing |
| 7853 | 7875 | * |
| 7854 | 7876 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| @@ -7861,11 +7883,11 @@ | ||
| 7861 | 7883 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7862 | 7884 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7863 | 7885 | ** |
| 7864 | 7886 | ** See also: [sqlite3_strlike()]. |
| 7865 | 7887 | */ |
| 7866 | -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr); | |
| 7888 | +SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr); | |
| 7867 | 7889 | |
| 7868 | 7890 | /* |
| 7869 | 7891 | ** CAPI3REF: String LIKE Matching |
| 7870 | 7892 | * |
| 7871 | 7893 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| @@ -7884,11 +7906,11 @@ | ||
| 7884 | 7906 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7885 | 7907 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7886 | 7908 | ** |
| 7887 | 7909 | ** See also: [sqlite3_strglob()]. |
| 7888 | 7910 | */ |
| 7889 | -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); | |
| 7911 | +SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); | |
| 7890 | 7912 | |
| 7891 | 7913 | /* |
| 7892 | 7914 | ** CAPI3REF: Error Logging Interface |
| 7893 | 7915 | ** |
| 7894 | 7916 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| @@ -7943,13 +7965,13 @@ | ||
| 7943 | 7965 | ** previously registered write-ahead log callback. ^Note that the |
| 7944 | 7966 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7945 | 7967 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7946 | 7968 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7947 | 7969 | */ |
| 7948 | -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( | |
| 7970 | +SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook( | |
| 7949 | 7971 | sqlite3*, |
| 7950 | - int(*)(void *,sqlite3*,const char*,int), | |
| 7972 | + int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int), | |
| 7951 | 7973 | void* |
| 7952 | 7974 | ); |
| 7953 | 7975 | |
| 7954 | 7976 | /* |
| 7955 | 7977 | ** CAPI3REF: Configure an auto-checkpoint |
| @@ -7978,11 +8000,11 @@ | ||
| 7978 | 8000 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 7979 | 8001 | ** pages. The use of this interface |
| 7980 | 8002 | ** is only necessary if the default setting is found to be suboptimal |
| 7981 | 8003 | ** for a particular application. |
| 7982 | 8004 | */ |
| 7983 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); | |
| 8005 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); | |
| 7984 | 8006 | |
| 7985 | 8007 | /* |
| 7986 | 8008 | ** CAPI3REF: Checkpoint a database |
| 7987 | 8009 | ** METHOD: sqlite3 |
| 7988 | 8010 | ** |
| @@ -8000,11 +8022,11 @@ | ||
| 8000 | 8022 | ** interface was added. This interface is retained for backwards |
| 8001 | 8023 | ** compatibility and as a convenience for applications that need to manually |
| 8002 | 8024 | ** start a callback but which do not need the full power (and corresponding |
| 8003 | 8025 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 8004 | 8026 | */ |
| 8005 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); | |
| 8027 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); | |
| 8006 | 8028 | |
| 8007 | 8029 | /* |
| 8008 | 8030 | ** CAPI3REF: Checkpoint a database |
| 8009 | 8031 | ** METHOD: sqlite3 |
| 8010 | 8032 | ** |
| @@ -8094,11 +8116,11 @@ | ||
| 8094 | 8116 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 8095 | 8117 | ** |
| 8096 | 8118 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 8097 | 8119 | ** from SQL. |
| 8098 | 8120 | */ |
| 8099 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( | |
| 8121 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2( | |
| 8100 | 8122 | sqlite3 *db, /* Database handle */ |
| 8101 | 8123 | const char *zDb, /* Name of attached database (or NULL) */ |
| 8102 | 8124 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 8103 | 8125 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 8104 | 8126 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -8183,11 +8205,11 @@ | ||
| 8183 | 8205 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 8184 | 8206 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 8185 | 8207 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 8186 | 8208 | ** [virtual table]. |
| 8187 | 8209 | */ |
| 8188 | -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *); | |
| 8210 | +SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *); | |
| 8189 | 8211 | |
| 8190 | 8212 | /* |
| 8191 | 8213 | ** CAPI3REF: Conflict resolution modes |
| 8192 | 8214 | ** KEYWORDS: {conflict resolution mode} |
| 8193 | 8215 | ** |
| @@ -8288,11 +8310,11 @@ | ||
| 8288 | 8310 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8289 | 8311 | ** that pOut points to unchanged. |
| 8290 | 8312 | ** |
| 8291 | 8313 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8292 | 8314 | */ |
| 8293 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( | |
| 8315 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus( | |
| 8294 | 8316 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8295 | 8317 | int idx, /* Index of loop to report on */ |
| 8296 | 8318 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8297 | 8319 | void *pOut /* Result written here */ |
| 8298 | 8320 | ); |
| @@ -8304,11 +8326,11 @@ | ||
| 8304 | 8326 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8305 | 8327 | ** |
| 8306 | 8328 | ** This API is only available if the library is built with pre-processor |
| 8307 | 8329 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8308 | 8330 | */ |
| 8309 | -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); | |
| 8331 | +SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); | |
| 8310 | 8332 | |
| 8311 | 8333 | /* |
| 8312 | 8334 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8313 | 8335 | ** |
| 8314 | 8336 | ** ^If a write-transaction is open on [database connection] D when the |
| @@ -8336,11 +8358,11 @@ | ||
| 8336 | 8358 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8337 | 8359 | ** |
| 8338 | 8360 | ** ^This function does not set the database handle error code or message |
| 8339 | 8361 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8340 | 8362 | */ |
| 8341 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*); | |
| 8363 | +SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*); | |
| 8342 | 8364 | |
| 8343 | 8365 | /* |
| 8344 | 8366 | ** CAPI3REF: The pre-update hook. |
| 8345 | 8367 | ** |
| 8346 | 8368 | ** ^These interfaces are only available if SQLite is compiled using the |
| @@ -8416,13 +8438,13 @@ | ||
| 8416 | 8438 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8417 | 8439 | ** triggers; and so forth. |
| 8418 | 8440 | ** |
| 8419 | 8441 | ** See also: [sqlite3_update_hook()] |
| 8420 | 8442 | */ |
| 8421 | -SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook( | |
| 8443 | +SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook( | |
| 8422 | 8444 | sqlite3 *db, |
| 8423 | - void(*xPreUpdate)( | |
| 8445 | + void(SQLITE_CALLBACK *xPreUpdate)( | |
| 8424 | 8446 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8425 | 8447 | sqlite3 *db, /* Database handle */ |
| 8426 | 8448 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| 8427 | 8449 | char const *zDb, /* Database name */ |
| 8428 | 8450 | char const *zName, /* Table name */ |
| @@ -8429,14 +8451,14 @@ | ||
| 8429 | 8451 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8430 | 8452 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8431 | 8453 | ), |
| 8432 | 8454 | void* |
| 8433 | 8455 | ); |
| 8434 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); | |
| 8435 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *); | |
| 8436 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *); | |
| 8437 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); | |
| 8456 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); | |
| 8457 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *); | |
| 8458 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *); | |
| 8459 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); | |
| 8438 | 8460 | |
| 8439 | 8461 | /* |
| 8440 | 8462 | ** CAPI3REF: Low-level system error code |
| 8441 | 8463 | ** |
| 8442 | 8464 | ** ^Attempt to return the underlying operating system error code or error |
| @@ -8444,11 +8466,11 @@ | ||
| 8444 | 8466 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8445 | 8467 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8446 | 8468 | ** called to get back the underlying "errno" that caused the problem, such |
| 8447 | 8469 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8448 | 8470 | */ |
| 8449 | -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*); | |
| 8471 | +SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*); | |
| 8450 | 8472 | |
| 8451 | 8473 | /* |
| 8452 | 8474 | ** CAPI3REF: Database Snapshot |
| 8453 | 8475 | ** KEYWORDS: {snapshot} |
| 8454 | 8476 | ** EXPERIMENTAL |
| @@ -8494,11 +8516,11 @@ | ||
| 8494 | 8516 | ** to avoid a memory leak. |
| 8495 | 8517 | ** |
| 8496 | 8518 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8497 | 8519 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8498 | 8520 | */ |
| 8499 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get( | |
| 8521 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get( | |
| 8500 | 8522 | sqlite3 *db, |
| 8501 | 8523 | const char *zSchema, |
| 8502 | 8524 | sqlite3_snapshot **ppSnapshot |
| 8503 | 8525 | ); |
| 8504 | 8526 | |
| @@ -8532,11 +8554,11 @@ | ||
| 8532 | 8554 | ** database connection in order to make it ready to use snapshots.) |
| 8533 | 8555 | ** |
| 8534 | 8556 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8535 | 8557 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8536 | 8558 | */ |
| 8537 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open( | |
| 8559 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open( | |
| 8538 | 8560 | sqlite3 *db, |
| 8539 | 8561 | const char *zSchema, |
| 8540 | 8562 | sqlite3_snapshot *pSnapshot |
| 8541 | 8563 | ); |
| 8542 | 8564 | |
| @@ -8549,11 +8571,11 @@ | ||
| 8549 | 8571 | ** using this routine to avoid a memory leak. |
| 8550 | 8572 | ** |
| 8551 | 8573 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8552 | 8574 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8553 | 8575 | */ |
| 8554 | -SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*); | |
| 8576 | +SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*); | |
| 8555 | 8577 | |
| 8556 | 8578 | /* |
| 8557 | 8579 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8558 | 8580 | ** EXPERIMENTAL |
| 8559 | 8581 | ** |
| @@ -8573,11 +8595,11 @@ | ||
| 8573 | 8595 | ** |
| 8574 | 8596 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8575 | 8597 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8576 | 8598 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8577 | 8599 | */ |
| 8578 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp( | |
| 8600 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp( | |
| 8579 | 8601 | sqlite3_snapshot *p1, |
| 8580 | 8602 | sqlite3_snapshot *p2 |
| 8581 | 8603 | ); |
| 8582 | 8604 | |
| 8583 | 8605 | /* |
| @@ -8631,14 +8653,14 @@ | ||
| 8631 | 8653 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8632 | 8654 | ** R-Tree geometry query as follows: |
| 8633 | 8655 | ** |
| 8634 | 8656 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8635 | 8657 | */ |
| 8636 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( | |
| 8658 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback( | |
| 8637 | 8659 | sqlite3 *db, |
| 8638 | 8660 | const char *zGeom, |
| 8639 | - int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), | |
| 8661 | + int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), | |
| 8640 | 8662 | void *pContext |
| 8641 | 8663 | ); |
| 8642 | 8664 | |
| 8643 | 8665 | |
| 8644 | 8666 | /* |
| @@ -8648,25 +8670,25 @@ | ||
| 8648 | 8670 | struct sqlite3_rtree_geometry { |
| 8649 | 8671 | void *pContext; /* Copy of pContext passed to s_r_g_c() */ |
| 8650 | 8672 | int nParam; /* Size of array aParam[] */ |
| 8651 | 8673 | sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ |
| 8652 | 8674 | void *pUser; /* Callback implementation user data */ |
| 8653 | - void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ | |
| 8675 | + void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */ | |
| 8654 | 8676 | }; |
| 8655 | 8677 | |
| 8656 | 8678 | /* |
| 8657 | 8679 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8658 | 8680 | ** used as part of an R-Tree geometry query as follows: |
| 8659 | 8681 | ** |
| 8660 | 8682 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8661 | 8683 | */ |
| 8662 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( | |
| 8684 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback( | |
| 8663 | 8685 | sqlite3 *db, |
| 8664 | 8686 | const char *zQueryFunc, |
| 8665 | - int (*xQueryFunc)(sqlite3_rtree_query_info*), | |
| 8687 | + int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*), | |
| 8666 | 8688 | void *pContext, |
| 8667 | - void (*xDestructor)(void*) | |
| 8689 | + void (SQLITE_CALLBACK *xDestructor)(void*) | |
| 8668 | 8690 | ); |
| 8669 | 8691 | |
| 8670 | 8692 | |
| 8671 | 8693 | /* |
| 8672 | 8694 | ** A pointer to a structure of the following type is passed as the |
| @@ -8680,11 +8702,11 @@ | ||
| 8680 | 8702 | struct sqlite3_rtree_query_info { |
| 8681 | 8703 | void *pContext; /* pContext from when function registered */ |
| 8682 | 8704 | int nParam; /* Number of function parameters */ |
| 8683 | 8705 | sqlite3_rtree_dbl *aParam; /* value of function parameters */ |
| 8684 | 8706 | void *pUser; /* callback can use this, if desired */ |
| 8685 | - void (*xDelUser)(void*); /* function to free pUser */ | |
| 8707 | + void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */ | |
| 8686 | 8708 | sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ |
| 8687 | 8709 | unsigned int *anQueue; /* Number of pending entries in the queue */ |
| 8688 | 8710 | int nCoord; /* Number of coordinates */ |
| 8689 | 8711 | int iLevel; /* Level of current node or entry */ |
| 8690 | 8712 | int mxLevel; /* The largest iLevel value in the tree */ |
| @@ -8876,11 +8898,11 @@ | ||
| 8876 | 8898 | ** If xFilter returns 0, changes is not tracked. Note that once a table is |
| 8877 | 8899 | ** attached, xFilter will not be called again. |
| 8878 | 8900 | */ |
| 8879 | 8901 | void sqlite3session_table_filter( |
| 8880 | 8902 | sqlite3_session *pSession, /* Session object */ |
| 8881 | - int(*xFilter)( | |
| 8903 | + int(SQLITE_CALLBACK *xFilter)( | |
| 8882 | 8904 | void *pCtx, /* Copy of third arg to _filter_table() */ |
| 8883 | 8905 | const char *zTab /* Table name */ |
| 8884 | 8906 | ), |
| 8885 | 8907 | void *pCtx /* First argument passed to xFilter */ |
| 8886 | 8908 | ); |
| @@ -9451,11 +9473,11 @@ | ||
| 9451 | 9473 | ** An sqlite3_changegroup object is used to combine two or more changesets |
| 9452 | 9474 | ** (or patchsets) into a single changeset (or patchset). A single changegroup |
| 9453 | 9475 | ** object may combine changesets or patchsets, but not both. The output is |
| 9454 | 9476 | ** always in the same format as the input. |
| 9455 | 9477 | ** |
| 9456 | -** If successful, this function returns SQLITE_OK and populates (*pp) with | |
| 9478 | +** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with | |
| 9457 | 9479 | ** a pointer to a new sqlite3_changegroup object before returning. The caller |
| 9458 | 9480 | ** should eventually free the returned object using a call to |
| 9459 | 9481 | ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code |
| 9460 | 9482 | ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. |
| 9461 | 9483 | ** |
| @@ -9571,11 +9593,11 @@ | ||
| 9571 | 9593 | ** changes for tables that do not appear in the first changeset, they are |
| 9572 | 9594 | ** appended onto the end of the output changeset, again in the order in |
| 9573 | 9595 | ** which they are first encountered. |
| 9574 | 9596 | ** |
| 9575 | 9597 | ** If an error occurs, an SQLite error code is returned and the output |
| 9576 | -** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK | |
| 9598 | +** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK | |
| 9577 | 9599 | ** is returned and the output variables are set to the size of and a |
| 9578 | 9600 | ** pointer to the output buffer, respectively. In this case it is the |
| 9579 | 9601 | ** responsibility of the caller to eventually free the buffer using a |
| 9580 | 9602 | ** call to sqlite3_free(). |
| 9581 | 9603 | */ |
| @@ -9728,15 +9750,15 @@ | ||
| 9728 | 9750 | */ |
| 9729 | 9751 | int sqlite3changeset_apply( |
| 9730 | 9752 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9731 | 9753 | int nChangeset, /* Size of changeset in bytes */ |
| 9732 | 9754 | void *pChangeset, /* Changeset blob */ |
| 9733 | - int(*xFilter)( | |
| 9755 | + int(SQLITE_CALLBACK *xFilter)( | |
| 9734 | 9756 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9735 | 9757 | const char *zTab /* Table name */ |
| 9736 | 9758 | ), |
| 9737 | - int(*xConflict)( | |
| 9759 | + int(SQLITE_CALLBACK *xConflict)( | |
| 9738 | 9760 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9739 | 9761 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9740 | 9762 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9741 | 9763 | ), |
| 9742 | 9764 | void *pCtx /* First argument passed to xConflict */ |
| @@ -9873,20 +9895,20 @@ | ||
| 9873 | 9895 | ** </pre> |
| 9874 | 9896 | ** |
| 9875 | 9897 | ** Is replaced by: |
| 9876 | 9898 | ** |
| 9877 | 9899 | ** <pre> |
| 9878 | -** int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9900 | +** int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9879 | 9901 | ** void *pIn, |
| 9880 | 9902 | ** </pre> |
| 9881 | 9903 | ** |
| 9882 | 9904 | ** Each time the xInput callback is invoked by the sessions module, the first |
| 9883 | 9905 | ** argument passed is a copy of the supplied pIn context pointer. The second |
| 9884 | -** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no | |
| 9885 | -** error occurs the xInput method should copy up to (*pnData) bytes of data | |
| 9886 | -** into the buffer and set (*pnData) to the actual number of bytes copied | |
| 9887 | -** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) | |
| 9906 | +** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no | |
| 9907 | +** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data | |
| 9908 | +** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied | |
| 9909 | +** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData) | |
| 9888 | 9910 | ** should be set to zero to indicate this. Or, if an error occurs, an SQLite |
| 9889 | 9911 | ** error code should be returned. In all cases, if an xInput callback returns |
| 9890 | 9912 | ** an error, all processing is abandoned and the streaming API function |
| 9891 | 9913 | ** returns a copy of the error code to the caller. |
| 9892 | 9914 | ** |
| @@ -9907,11 +9929,11 @@ | ||
| 9907 | 9929 | ** </pre> |
| 9908 | 9930 | ** |
| 9909 | 9931 | ** Is replaced by: |
| 9910 | 9932 | ** |
| 9911 | 9933 | ** <pre> |
| 9912 | -** int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9934 | +** int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9913 | 9935 | ** void *pOut |
| 9914 | 9936 | ** </pre> |
| 9915 | 9937 | ** |
| 9916 | 9938 | ** The xOutput callback is invoked zero or more times to return data to |
| 9917 | 9939 | ** the application. The first parameter passed to each call is a copy of the |
| @@ -9927,58 +9949,58 @@ | ||
| 9927 | 9949 | ** parameter set to a value less than or equal to zero. Other than this, |
| 9928 | 9950 | ** no guarantees are made as to the size of the chunks of data returned. |
| 9929 | 9951 | */ |
| 9930 | 9952 | int sqlite3changeset_apply_strm( |
| 9931 | 9953 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9932 | - int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ | |
| 9954 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */ | |
| 9933 | 9955 | void *pIn, /* First arg for xInput */ |
| 9934 | - int(*xFilter)( | |
| 9956 | + int(SQLITE_CALLBACK *xFilter)( | |
| 9935 | 9957 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9936 | 9958 | const char *zTab /* Table name */ |
| 9937 | 9959 | ), |
| 9938 | - int(*xConflict)( | |
| 9960 | + int(SQLITE_CALLBACK *xConflict)( | |
| 9939 | 9961 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9940 | 9962 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9941 | 9963 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9942 | 9964 | ), |
| 9943 | 9965 | void *pCtx /* First argument passed to xConflict */ |
| 9944 | 9966 | ); |
| 9945 | 9967 | int sqlite3changeset_concat_strm( |
| 9946 | - int (*xInputA)(void *pIn, void *pData, int *pnData), | |
| 9968 | + int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData), | |
| 9947 | 9969 | void *pInA, |
| 9948 | - int (*xInputB)(void *pIn, void *pData, int *pnData), | |
| 9970 | + int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData), | |
| 9949 | 9971 | void *pInB, |
| 9950 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9972 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9951 | 9973 | void *pOut |
| 9952 | 9974 | ); |
| 9953 | 9975 | int sqlite3changeset_invert_strm( |
| 9954 | - int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9976 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9955 | 9977 | void *pIn, |
| 9956 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9978 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9957 | 9979 | void *pOut |
| 9958 | 9980 | ); |
| 9959 | 9981 | int sqlite3changeset_start_strm( |
| 9960 | 9982 | sqlite3_changeset_iter **pp, |
| 9961 | - int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9983 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9962 | 9984 | void *pIn |
| 9963 | 9985 | ); |
| 9964 | 9986 | int sqlite3session_changeset_strm( |
| 9965 | 9987 | sqlite3_session *pSession, |
| 9966 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9988 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9967 | 9989 | void *pOut |
| 9968 | 9990 | ); |
| 9969 | 9991 | int sqlite3session_patchset_strm( |
| 9970 | 9992 | sqlite3_session *pSession, |
| 9971 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9993 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9972 | 9994 | void *pOut |
| 9973 | 9995 | ); |
| 9974 | 9996 | int sqlite3changegroup_add_strm(sqlite3_changegroup*, |
| 9975 | - int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9997 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9976 | 9998 | void *pIn |
| 9977 | 9999 | ); |
| 9978 | 10000 | int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 9979 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 10001 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9980 | 10002 | void *pOut |
| 9981 | 10003 | ); |
| 9982 | 10004 | |
| 9983 | 10005 | |
| 9984 | 10006 | /* |
| @@ -10029,11 +10051,11 @@ | ||
| 10029 | 10051 | |
| 10030 | 10052 | typedef struct Fts5ExtensionApi Fts5ExtensionApi; |
| 10031 | 10053 | typedef struct Fts5Context Fts5Context; |
| 10032 | 10054 | typedef struct Fts5PhraseIter Fts5PhraseIter; |
| 10033 | 10055 | |
| 10034 | -typedef void (*fts5_extension_function)( | |
| 10056 | +typedef void (SQLITE_CALLBACK *fts5_extension_function)( | |
| 10035 | 10057 | const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ |
| 10036 | 10058 | Fts5Context *pFts, /* First arg to pass to pApi functions */ |
| 10037 | 10059 | sqlite3_context *pCtx, /* Context for returning result/error */ |
| 10038 | 10060 | int nVal, /* Number of values in apVal[] array */ |
| 10039 | 10061 | sqlite3_value **apVal /* Array of trailing arguments */ |
| @@ -10080,15 +10102,15 @@ | ||
| 10080 | 10102 | ** This function may be quite inefficient if used with an FTS5 table |
| 10081 | 10103 | ** created with the "columnsize=0" option. |
| 10082 | 10104 | ** |
| 10083 | 10105 | ** xColumnText: |
| 10084 | 10106 | ** This function attempts to retrieve the text of column iCol of the |
| 10085 | -** current document. If successful, (*pz) is set to point to a buffer | |
| 10086 | -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes | |
| 10107 | +** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer | |
| 10108 | +** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes | |
| 10087 | 10109 | ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, |
| 10088 | 10110 | ** if an error occurs, an SQLite error code is returned and the final values |
| 10089 | -** of (*pz) and (*pn) are undefined. | |
| 10111 | +** of (SQLITE_CALLBACK *pz) and (*pn) are undefined. | |
| 10090 | 10112 | ** |
| 10091 | 10113 | ** xPhraseCount: |
| 10092 | 10114 | ** Returns the number of phrases in the current query expression. |
| 10093 | 10115 | ** |
| 10094 | 10116 | ** xPhraseSize: |
| @@ -10193,11 +10215,11 @@ | ||
| 10193 | 10215 | ** xRowCount(pFts5, pnRow) |
| 10194 | 10216 | ** |
| 10195 | 10217 | ** This function is used to retrieve the total number of rows in the table. |
| 10196 | 10218 | ** In other words, the same value that would be returned by: |
| 10197 | 10219 | ** |
| 10198 | -** SELECT count(*) FROM ftstable; | |
| 10220 | +** SELECT count(SQLITE_CALLBACK *) FROM ftstable; | |
| 10199 | 10221 | ** |
| 10200 | 10222 | ** xPhraseFirst() |
| 10201 | 10223 | ** This function is used, along with type Fts5PhraseIter and the xPhraseNext |
| 10202 | 10224 | ** method, to iterate through all instances of a single query phrase within |
| 10203 | 10225 | ** the current row. This is the same information as is accessible via the |
| @@ -10260,43 +10282,43 @@ | ||
| 10260 | 10282 | ** See xPhraseFirstColumn above. |
| 10261 | 10283 | */ |
| 10262 | 10284 | struct Fts5ExtensionApi { |
| 10263 | 10285 | int iVersion; /* Currently always set to 3 */ |
| 10264 | 10286 | |
| 10265 | - void *(*xUserData)(Fts5Context*); | |
| 10287 | + void *(SQLITE_CALLBACK *xUserData)(Fts5Context*); | |
| 10266 | 10288 | |
| 10267 | - int (*xColumnCount)(Fts5Context*); | |
| 10268 | - int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); | |
| 10269 | - int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); | |
| 10289 | + int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*); | |
| 10290 | + int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); | |
| 10291 | + int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); | |
| 10270 | 10292 | |
| 10271 | - int (*xTokenize)(Fts5Context*, | |
| 10293 | + int (SQLITE_CALLBACK *xTokenize)(Fts5Context*, | |
| 10272 | 10294 | const char *pText, int nText, /* Text to tokenize */ |
| 10273 | 10295 | void *pCtx, /* Context passed to xToken() */ |
| 10274 | - int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ | |
| 10275 | - ); | |
| 10276 | - | |
| 10277 | - int (*xPhraseCount)(Fts5Context*); | |
| 10278 | - int (*xPhraseSize)(Fts5Context*, int iPhrase); | |
| 10279 | - | |
| 10280 | - int (*xInstCount)(Fts5Context*, int *pnInst); | |
| 10281 | - int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); | |
| 10282 | - | |
| 10283 | - sqlite3_int64 (*xRowid)(Fts5Context*); | |
| 10284 | - int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); | |
| 10285 | - int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); | |
| 10286 | - | |
| 10287 | - int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, | |
| 10288 | - int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) | |
| 10289 | - ); | |
| 10290 | - int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); | |
| 10291 | - void *(*xGetAuxdata)(Fts5Context*, int bClear); | |
| 10292 | - | |
| 10293 | - int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); | |
| 10294 | - void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); | |
| 10295 | - | |
| 10296 | - int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); | |
| 10297 | - void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); | |
| 10296 | + int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */ | |
| 10297 | + ); | |
| 10298 | + | |
| 10299 | + int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*); | |
| 10300 | + int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase); | |
| 10301 | + | |
| 10302 | + int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst); | |
| 10303 | + int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); | |
| 10304 | + | |
| 10305 | + sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*); | |
| 10306 | + int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); | |
| 10307 | + int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken); | |
| 10308 | + | |
| 10309 | + int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, | |
| 10310 | + int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*) | |
| 10311 | + ); | |
| 10312 | + int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); | |
| 10313 | + void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear); | |
| 10314 | + | |
| 10315 | + int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); | |
| 10316 | + void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); | |
| 10317 | + | |
| 10318 | + int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); | |
| 10319 | + void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); | |
| 10298 | 10320 | }; |
| 10299 | 10321 | |
| 10300 | 10322 | /* |
| 10301 | 10323 | ** CUSTOM AUXILIARY FUNCTIONS |
| 10302 | 10324 | *************************************************************************/ |
| @@ -10320,11 +10342,11 @@ | ||
| 10320 | 10342 | ** The second and third arguments are an array of nul-terminated strings |
| 10321 | 10343 | ** containing the tokenizer arguments, if any, specified following the |
| 10322 | 10344 | ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used |
| 10323 | 10345 | ** to create the FTS5 table. |
| 10324 | 10346 | ** |
| 10325 | -** The final argument is an output variable. If successful, (*ppOut) | |
| 10347 | +** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut) | |
| 10326 | 10348 | ** should be set to point to the new tokenizer handle and SQLITE_OK |
| 10327 | 10349 | ** returned. If an error occurs, some value other than SQLITE_OK should |
| 10328 | 10350 | ** be returned. In this case, fts5 assumes that the final value of *ppOut |
| 10329 | 10351 | ** is undefined. |
| 10330 | 10352 | ** |
| @@ -10494,17 +10516,17 @@ | ||
| 10494 | 10516 | ** inefficient. |
| 10495 | 10517 | */ |
| 10496 | 10518 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| 10497 | 10519 | typedef struct fts5_tokenizer fts5_tokenizer; |
| 10498 | 10520 | struct fts5_tokenizer { |
| 10499 | - int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); | |
| 10500 | - void (*xDelete)(Fts5Tokenizer*); | |
| 10501 | - int (*xTokenize)(Fts5Tokenizer*, | |
| 10521 | + int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); | |
| 10522 | + void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*); | |
| 10523 | + int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*, | |
| 10502 | 10524 | void *pCtx, |
| 10503 | 10525 | int flags, /* Mask of FTS5_TOKENIZE_* flags */ |
| 10504 | 10526 | const char *pText, int nText, |
| 10505 | - int (*xToken)( | |
| 10527 | + int (SQLITE_CALLBACK *xToken)( | |
| 10506 | 10528 | void *pCtx, /* Copy of 2nd argument to xTokenize() */ |
| 10507 | 10529 | int tflags, /* Mask of FTS5_TOKEN_* flags */ |
| 10508 | 10530 | const char *pToken, /* Pointer to buffer containing token */ |
| 10509 | 10531 | int nToken, /* Size of token in bytes */ |
| 10510 | 10532 | int iStart, /* Byte offset of token within input text */ |
| @@ -10533,33 +10555,33 @@ | ||
| 10533 | 10555 | typedef struct fts5_api fts5_api; |
| 10534 | 10556 | struct fts5_api { |
| 10535 | 10557 | int iVersion; /* Currently always set to 2 */ |
| 10536 | 10558 | |
| 10537 | 10559 | /* Create a new tokenizer */ |
| 10538 | - int (*xCreateTokenizer)( | |
| 10560 | + int (SQLITE_CALLBACK *xCreateTokenizer)( | |
| 10539 | 10561 | fts5_api *pApi, |
| 10540 | 10562 | const char *zName, |
| 10541 | 10563 | void *pContext, |
| 10542 | 10564 | fts5_tokenizer *pTokenizer, |
| 10543 | - void (*xDestroy)(void*) | |
| 10565 | + void (SQLITE_CALLBACK *xDestroy)(void*) | |
| 10544 | 10566 | ); |
| 10545 | 10567 | |
| 10546 | 10568 | /* Find an existing tokenizer */ |
| 10547 | - int (*xFindTokenizer)( | |
| 10569 | + int (SQLITE_CALLBACK *xFindTokenizer)( | |
| 10548 | 10570 | fts5_api *pApi, |
| 10549 | 10571 | const char *zName, |
| 10550 | 10572 | void **ppContext, |
| 10551 | 10573 | fts5_tokenizer *pTokenizer |
| 10552 | 10574 | ); |
| 10553 | 10575 | |
| 10554 | 10576 | /* Create a new auxiliary function */ |
| 10555 | - int (*xCreateFunction)( | |
| 10577 | + int (SQLITE_CALLBACK *xCreateFunction)( | |
| 10556 | 10578 | fts5_api *pApi, |
| 10557 | 10579 | const char *zName, |
| 10558 | 10580 | void *pContext, |
| 10559 | 10581 | fts5_extension_function xFunction, |
| 10560 | - void (*xDestroy)(void*) | |
| 10582 | + void (SQLITE_CALLBACK *xDestroy)(void*) | |
| 10561 | 10583 | ); |
| 10562 | 10584 | }; |
| 10563 | 10585 | |
| 10564 | 10586 | /* |
| 10565 | 10587 | ** END OF REGISTRATION API |
| @@ -11873,12 +11895,12 @@ | ||
| 11873 | 11895 | */ |
| 11874 | 11896 | #ifdef SQLITE_OMIT_WSD |
| 11875 | 11897 | #define SQLITE_WSD const |
| 11876 | 11898 | #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v))) |
| 11877 | 11899 | #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config) |
| 11878 | -SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J); | |
| 11879 | -SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L); | |
| 11900 | +SQLITE_API int SQLITE_APICALL sqlite3_wsd_init(int N, int J); | |
| 11901 | +SQLITE_API void *SQLITE_APICALL sqlite3_wsd_find(void *K, int L); | |
| 11880 | 11902 | #else |
| 11881 | 11903 | #define SQLITE_WSD |
| 11882 | 11904 | #define GLOBAL(t,v) v |
| 11883 | 11905 | #define sqlite3GlobalConfig sqlite3Config |
| 11884 | 11906 | #endif |
| @@ -17165,12 +17187,14 @@ | ||
| 17165 | 17187 | "CASE_SENSITIVE_LIKE", |
| 17166 | 17188 | #endif |
| 17167 | 17189 | #if SQLITE_CHECK_PAGES |
| 17168 | 17190 | "CHECK_PAGES", |
| 17169 | 17191 | #endif |
| 17170 | -#if defined(__clang__) && defined(__clang_version__) | |
| 17171 | - "COMPILER=clang-" __clang_version__, | |
| 17192 | +#if defined(__clang__) && defined(__clang_major__) | |
| 17193 | + "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "." | |
| 17194 | + CTIMEOPT_VAL(__clang_minor__) "." | |
| 17195 | + CTIMEOPT_VAL(__clang_patchlevel__), | |
| 17172 | 17196 | #elif defined(_MSC_VER) |
| 17173 | 17197 | "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER), |
| 17174 | 17198 | #elif defined(__GNUC__) && defined(__VERSION__) |
| 17175 | 17199 | "COMPILER=gcc-" __VERSION__, |
| 17176 | 17200 | #endif |
| @@ -17531,11 +17555,11 @@ | ||
| 17531 | 17555 | ** was used and false if not. |
| 17532 | 17556 | ** |
| 17533 | 17557 | ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix |
| 17534 | 17558 | ** is not required for a match. |
| 17535 | 17559 | */ |
| 17536 | -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){ | |
| 17560 | +SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){ | |
| 17537 | 17561 | int i, n; |
| 17538 | 17562 | |
| 17539 | 17563 | #if SQLITE_ENABLE_API_ARMOR |
| 17540 | 17564 | if( zOptName==0 ){ |
| 17541 | 17565 | (void)SQLITE_MISUSE_BKPT; |
| @@ -17559,11 +17583,11 @@ | ||
| 17559 | 17583 | |
| 17560 | 17584 | /* |
| 17561 | 17585 | ** Return the N-th compile-time option string. If N is out of range, |
| 17562 | 17586 | ** return a NULL pointer. |
| 17563 | 17587 | */ |
| 17564 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){ | |
| 17588 | +SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){ | |
| 17565 | 17589 | if( N>=0 && N<ArraySize(azCompileOpt) ){ |
| 17566 | 17590 | return azCompileOpt[N]; |
| 17567 | 17591 | } |
| 17568 | 17592 | return 0; |
| 17569 | 17593 | } |
| @@ -18269,11 +18293,11 @@ | ||
| 18269 | 18293 | } |
| 18270 | 18294 | |
| 18271 | 18295 | /* |
| 18272 | 18296 | ** Query status information. |
| 18273 | 18297 | */ |
| 18274 | -SQLITE_API int SQLITE_STDCALL sqlite3_status64( | |
| 18298 | +SQLITE_API int SQLITE_APICALL sqlite3_status64( | |
| 18275 | 18299 | int op, |
| 18276 | 18300 | sqlite3_int64 *pCurrent, |
| 18277 | 18301 | sqlite3_int64 *pHighwater, |
| 18278 | 18302 | int resetFlag |
| 18279 | 18303 | ){ |
| @@ -18294,11 +18318,11 @@ | ||
| 18294 | 18318 | } |
| 18295 | 18319 | sqlite3_mutex_leave(pMutex); |
| 18296 | 18320 | (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */ |
| 18297 | 18321 | return SQLITE_OK; |
| 18298 | 18322 | } |
| 18299 | -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ | |
| 18323 | +SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ | |
| 18300 | 18324 | sqlite3_int64 iCur, iHwtr; |
| 18301 | 18325 | int rc; |
| 18302 | 18326 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 18303 | 18327 | if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT; |
| 18304 | 18328 | #endif |
| @@ -18311,11 +18335,11 @@ | ||
| 18311 | 18335 | } |
| 18312 | 18336 | |
| 18313 | 18337 | /* |
| 18314 | 18338 | ** Query status information for a single database connection |
| 18315 | 18339 | */ |
| 18316 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_status( | |
| 18340 | +SQLITE_API int SQLITE_APICALL sqlite3_db_status( | |
| 18317 | 18341 | sqlite3 *db, /* The database connection whose status is desired */ |
| 18318 | 18342 | int op, /* Status verb */ |
| 18319 | 18343 | int *pCurrent, /* Write current value here */ |
| 18320 | 18344 | int *pHighwater, /* Write high-water mark here */ |
| 18321 | 18345 | int resetFlag /* Reset high-water mark if true */ |
| @@ -19989,11 +20013,11 @@ | ||
| 19989 | 20013 | |
| 19990 | 20014 | /* |
| 19991 | 20015 | ** Locate a VFS by name. If no name is given, simply return the |
| 19992 | 20016 | ** first VFS on the list. |
| 19993 | 20017 | */ |
| 19994 | -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){ | |
| 20018 | +SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){ | |
| 19995 | 20019 | sqlite3_vfs *pVfs = 0; |
| 19996 | 20020 | #if SQLITE_THREADSAFE |
| 19997 | 20021 | sqlite3_mutex *mutex; |
| 19998 | 20022 | #endif |
| 19999 | 20023 | #ifndef SQLITE_OMIT_AUTOINIT |
| @@ -20035,11 +20059,11 @@ | ||
| 20035 | 20059 | /* |
| 20036 | 20060 | ** Register a VFS with the system. It is harmless to register the same |
| 20037 | 20061 | ** VFS multiple times. The new VFS becomes the default if makeDflt is |
| 20038 | 20062 | ** true. |
| 20039 | 20063 | */ |
| 20040 | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ | |
| 20064 | +SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ | |
| 20041 | 20065 | MUTEX_LOGIC(sqlite3_mutex *mutex;) |
| 20042 | 20066 | #ifndef SQLITE_OMIT_AUTOINIT |
| 20043 | 20067 | int rc = sqlite3_initialize(); |
| 20044 | 20068 | if( rc ) return rc; |
| 20045 | 20069 | #endif |
| @@ -20063,11 +20087,11 @@ | ||
| 20063 | 20087 | } |
| 20064 | 20088 | |
| 20065 | 20089 | /* |
| 20066 | 20090 | ** Unregister a VFS so that it is no longer accessible. |
| 20067 | 20091 | */ |
| 20068 | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ | |
| 20092 | +SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ | |
| 20069 | 20093 | #if SQLITE_THREADSAFE |
| 20070 | 20094 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 20071 | 20095 | #endif |
| 20072 | 20096 | sqlite3_mutex_enter(mutex); |
| 20073 | 20097 | vfsUnlink(pVfs); |
| @@ -22414,11 +22438,11 @@ | ||
| 22414 | 22438 | } |
| 22415 | 22439 | |
| 22416 | 22440 | /* |
| 22417 | 22441 | ** Retrieve a pointer to a static mutex or allocate a new dynamic one. |
| 22418 | 22442 | */ |
| 22419 | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){ | |
| 22443 | +SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){ | |
| 22420 | 22444 | #ifndef SQLITE_OMIT_AUTOINIT |
| 22421 | 22445 | if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0; |
| 22422 | 22446 | if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0; |
| 22423 | 22447 | #endif |
| 22424 | 22448 | assert( sqlite3GlobalConfig.mutex.xMutexAlloc ); |
| @@ -22435,11 +22459,11 @@ | ||
| 22435 | 22459 | } |
| 22436 | 22460 | |
| 22437 | 22461 | /* |
| 22438 | 22462 | ** Free a dynamic mutex. |
| 22439 | 22463 | */ |
| 22440 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){ | |
| 22464 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){ | |
| 22441 | 22465 | if( p ){ |
| 22442 | 22466 | assert( sqlite3GlobalConfig.mutex.xMutexFree ); |
| 22443 | 22467 | sqlite3GlobalConfig.mutex.xMutexFree(p); |
| 22444 | 22468 | } |
| 22445 | 22469 | } |
| @@ -22446,11 +22470,11 @@ | ||
| 22446 | 22470 | |
| 22447 | 22471 | /* |
| 22448 | 22472 | ** Obtain the mutex p. If some other thread already has the mutex, block |
| 22449 | 22473 | ** until it can be obtained. |
| 22450 | 22474 | */ |
| 22451 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){ | |
| 22475 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){ | |
| 22452 | 22476 | if( p ){ |
| 22453 | 22477 | assert( sqlite3GlobalConfig.mutex.xMutexEnter ); |
| 22454 | 22478 | sqlite3GlobalConfig.mutex.xMutexEnter(p); |
| 22455 | 22479 | } |
| 22456 | 22480 | } |
| @@ -22457,11 +22481,11 @@ | ||
| 22457 | 22481 | |
| 22458 | 22482 | /* |
| 22459 | 22483 | ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another |
| 22460 | 22484 | ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. |
| 22461 | 22485 | */ |
| 22462 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){ | |
| 22486 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){ | |
| 22463 | 22487 | int rc = SQLITE_OK; |
| 22464 | 22488 | if( p ){ |
| 22465 | 22489 | assert( sqlite3GlobalConfig.mutex.xMutexTry ); |
| 22466 | 22490 | return sqlite3GlobalConfig.mutex.xMutexTry(p); |
| 22467 | 22491 | } |
| @@ -22472,11 +22496,11 @@ | ||
| 22472 | 22496 | ** The sqlite3_mutex_leave() routine exits a mutex that was previously |
| 22473 | 22497 | ** entered by the same thread. The behavior is undefined if the mutex |
| 22474 | 22498 | ** is not currently entered. If a NULL pointer is passed as an argument |
| 22475 | 22499 | ** this function is a no-op. |
| 22476 | 22500 | */ |
| 22477 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){ | |
| 22501 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){ | |
| 22478 | 22502 | if( p ){ |
| 22479 | 22503 | assert( sqlite3GlobalConfig.mutex.xMutexLeave ); |
| 22480 | 22504 | sqlite3GlobalConfig.mutex.xMutexLeave(p); |
| 22481 | 22505 | } |
| 22482 | 22506 | } |
| @@ -22484,15 +22508,15 @@ | ||
| 22484 | 22508 | #ifndef NDEBUG |
| 22485 | 22509 | /* |
| 22486 | 22510 | ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are |
| 22487 | 22511 | ** intended for use inside assert() statements. |
| 22488 | 22512 | */ |
| 22489 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){ | |
| 22513 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){ | |
| 22490 | 22514 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld ); |
| 22491 | 22515 | return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p); |
| 22492 | 22516 | } |
| 22493 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){ | |
| 22517 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){ | |
| 22494 | 22518 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld ); |
| 22495 | 22519 | return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p); |
| 22496 | 22520 | } |
| 22497 | 22521 | #endif |
| 22498 | 22522 | |
| @@ -23520,12 +23544,12 @@ | ||
| 23520 | 23544 | ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the |
| 23521 | 23545 | ** "interlocked" magic used here is probably not strictly necessary. |
| 23522 | 23546 | */ |
| 23523 | 23547 | static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0; |
| 23524 | 23548 | |
| 23525 | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */ | |
| 23526 | -SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ | |
| 23549 | +SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void); /* os_win.c */ | |
| 23550 | +SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ | |
| 23527 | 23551 | |
| 23528 | 23552 | static int winMutexInit(void){ |
| 23529 | 23553 | /* The first to increment to 1 does actual initialization */ |
| 23530 | 23554 | if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){ |
| 23531 | 23555 | int i; |
| @@ -23821,11 +23845,11 @@ | ||
| 23821 | 23845 | /* |
| 23822 | 23846 | ** Attempt to release up to n bytes of non-essential memory currently |
| 23823 | 23847 | ** held by SQLite. An example of non-essential memory is memory used to |
| 23824 | 23848 | ** cache database pages that are not currently in use. |
| 23825 | 23849 | */ |
| 23826 | -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){ | |
| 23850 | +SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){ | |
| 23827 | 23851 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 23828 | 23852 | return sqlite3PcacheReleaseMemory(n); |
| 23829 | 23853 | #else |
| 23830 | 23854 | /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine |
| 23831 | 23855 | ** is a no-op returning zero if SQLite is not compiled with |
| @@ -23880,11 +23904,11 @@ | ||
| 23880 | 23904 | /* |
| 23881 | 23905 | ** Deprecated external interface. It used to set an alarm callback |
| 23882 | 23906 | ** that was invoked when memory usage grew too large. Now it is a |
| 23883 | 23907 | ** no-op. |
| 23884 | 23908 | */ |
| 23885 | -SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm( | |
| 23909 | +SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm( | |
| 23886 | 23910 | void(*xCallback)(void *pArg, sqlite3_int64 used,int N), |
| 23887 | 23911 | void *pArg, |
| 23888 | 23912 | sqlite3_int64 iThreshold |
| 23889 | 23913 | ){ |
| 23890 | 23914 | (void)xCallback; |
| @@ -23896,11 +23920,11 @@ | ||
| 23896 | 23920 | |
| 23897 | 23921 | /* |
| 23898 | 23922 | ** Set the soft heap-size limit for the library. Passing a zero or |
| 23899 | 23923 | ** negative value indicates no limit. |
| 23900 | 23924 | */ |
| 23901 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){ | |
| 23925 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){ | |
| 23902 | 23926 | sqlite3_int64 priorLimit; |
| 23903 | 23927 | sqlite3_int64 excess; |
| 23904 | 23928 | sqlite3_int64 nUsed; |
| 23905 | 23929 | #ifndef SQLITE_OMIT_AUTOINIT |
| 23906 | 23930 | int rc = sqlite3_initialize(); |
| @@ -23918,11 +23942,11 @@ | ||
| 23918 | 23942 | sqlite3_mutex_leave(mem0.mutex); |
| 23919 | 23943 | excess = sqlite3_memory_used() - n; |
| 23920 | 23944 | if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); |
| 23921 | 23945 | return priorLimit; |
| 23922 | 23946 | } |
| 23923 | -SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){ | |
| 23947 | +SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){ | |
| 23924 | 23948 | if( n<0 ) n = 0; |
| 23925 | 23949 | sqlite3_soft_heap_limit64(n); |
| 23926 | 23950 | } |
| 23927 | 23951 | |
| 23928 | 23952 | /* |
| @@ -23987,11 +24011,11 @@ | ||
| 23987 | 24011 | } |
| 23988 | 24012 | |
| 23989 | 24013 | /* |
| 23990 | 24014 | ** Return the amount of memory currently checked out. |
| 23991 | 24015 | */ |
| 23992 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){ | |
| 24016 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){ | |
| 23993 | 24017 | sqlite3_int64 res, mx; |
| 23994 | 24018 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0); |
| 23995 | 24019 | return res; |
| 23996 | 24020 | } |
| 23997 | 24021 | |
| @@ -23998,11 +24022,11 @@ | ||
| 23998 | 24022 | /* |
| 23999 | 24023 | ** Return the maximum amount of memory that has ever been |
| 24000 | 24024 | ** checked out since either the beginning of this process |
| 24001 | 24025 | ** or since the most recent reset. |
| 24002 | 24026 | */ |
| 24003 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){ | |
| 24027 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){ | |
| 24004 | 24028 | sqlite3_int64 res, mx; |
| 24005 | 24029 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag); |
| 24006 | 24030 | return mx; |
| 24007 | 24031 | } |
| 24008 | 24032 | |
| @@ -24078,17 +24102,17 @@ | ||
| 24078 | 24102 | /* |
| 24079 | 24103 | ** This version of the memory allocation is for use by the application. |
| 24080 | 24104 | ** First make sure the memory subsystem is initialized, then do the |
| 24081 | 24105 | ** allocation. |
| 24082 | 24106 | */ |
| 24083 | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){ | |
| 24107 | +SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){ | |
| 24084 | 24108 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24085 | 24109 | if( sqlite3_initialize() ) return 0; |
| 24086 | 24110 | #endif |
| 24087 | 24111 | return n<=0 ? 0 : sqlite3Malloc(n); |
| 24088 | 24112 | } |
| 24089 | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){ | |
| 24113 | +SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){ | |
| 24090 | 24114 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24091 | 24115 | if( sqlite3_initialize() ) return 0; |
| 24092 | 24116 | #endif |
| 24093 | 24117 | return sqlite3Malloc(n); |
| 24094 | 24118 | } |
| @@ -24227,20 +24251,20 @@ | ||
| 24227 | 24251 | }else{ |
| 24228 | 24252 | assert( sqlite3_mutex_held(db->mutex) ); |
| 24229 | 24253 | return db->lookaside.sz; |
| 24230 | 24254 | } |
| 24231 | 24255 | } |
| 24232 | -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){ | |
| 24256 | +SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){ | |
| 24233 | 24257 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24234 | 24258 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24235 | 24259 | return p ? sqlite3GlobalConfig.m.xSize(p) : 0; |
| 24236 | 24260 | } |
| 24237 | 24261 | |
| 24238 | 24262 | /* |
| 24239 | 24263 | ** Free memory previously obtained from sqlite3Malloc(). |
| 24240 | 24264 | */ |
| 24241 | -SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){ | |
| 24265 | +SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){ | |
| 24242 | 24266 | if( p==0 ) return; /* IMP: R-49053-54554 */ |
| 24243 | 24267 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24244 | 24268 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24245 | 24269 | if( sqlite3GlobalConfig.bMemstat ){ |
| 24246 | 24270 | sqlite3_mutex_enter(mem0.mutex); |
| @@ -24345,18 +24369,18 @@ | ||
| 24345 | 24369 | |
| 24346 | 24370 | /* |
| 24347 | 24371 | ** The public interface to sqlite3Realloc. Make sure that the memory |
| 24348 | 24372 | ** subsystem is initialized prior to invoking sqliteRealloc. |
| 24349 | 24373 | */ |
| 24350 | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){ | |
| 24374 | +SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){ | |
| 24351 | 24375 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24352 | 24376 | if( sqlite3_initialize() ) return 0; |
| 24353 | 24377 | #endif |
| 24354 | 24378 | if( n<0 ) n = 0; /* IMP: R-26507-47431 */ |
| 24355 | 24379 | return sqlite3Realloc(pOld, n); |
| 24356 | 24380 | } |
| 24357 | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ | |
| 24381 | +SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ | |
| 24358 | 24382 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24359 | 24383 | if( sqlite3_initialize() ) return 0; |
| 24360 | 24384 | #endif |
| 24361 | 24385 | return sqlite3Realloc(pOld, n); |
| 24362 | 24386 | } |
| @@ -25579,11 +25603,11 @@ | ||
| 25579 | 25603 | |
| 25580 | 25604 | /* |
| 25581 | 25605 | ** Print into memory obtained from sqlite3_malloc(). Omit the internal |
| 25582 | 25606 | ** %-conversion extensions. |
| 25583 | 25607 | */ |
| 25584 | -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){ | |
| 25608 | +SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){ | |
| 25585 | 25609 | char *z; |
| 25586 | 25610 | char zBase[SQLITE_PRINT_BUF_SIZE]; |
| 25587 | 25611 | StrAccum acc; |
| 25588 | 25612 | |
| 25589 | 25613 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -25628,11 +25652,11 @@ | ||
| 25628 | 25652 | ** this without breaking compatibility, so we just have to live with the |
| 25629 | 25653 | ** mistake. |
| 25630 | 25654 | ** |
| 25631 | 25655 | ** sqlite3_vsnprintf() is the varargs version. |
| 25632 | 25656 | */ |
| 25633 | -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){ | |
| 25657 | +SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){ | |
| 25634 | 25658 | StrAccum acc; |
| 25635 | 25659 | if( n<=0 ) return zBuf; |
| 25636 | 25660 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 25637 | 25661 | if( zBuf==0 || zFormat==0 ) { |
| 25638 | 25662 | (void)SQLITE_MISUSE_BKPT; |
| @@ -26255,11 +26279,11 @@ | ||
| 26255 | 26279 | } sqlite3Prng; |
| 26256 | 26280 | |
| 26257 | 26281 | /* |
| 26258 | 26282 | ** Return N random bytes. |
| 26259 | 26283 | */ |
| 26260 | -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){ | |
| 26284 | +SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){ | |
| 26261 | 26285 | unsigned char t; |
| 26262 | 26286 | unsigned char *zBuf = pBuf; |
| 26263 | 26287 | |
| 26264 | 26288 | /* The "wsdPrng" macro will resolve to the pseudo-random number generator |
| 26265 | 26289 | ** state vector. If writable static data is unsupported on the target, |
| @@ -27458,11 +27482,11 @@ | ||
| 27458 | 27482 | ** sqlite3_strnicmp() APIs allow applications and extensions to compare |
| 27459 | 27483 | ** the contents of two buffers containing UTF-8 strings in a |
| 27460 | 27484 | ** case-independent fashion, using the same definition of "case |
| 27461 | 27485 | ** independence" that SQLite uses internally when comparing identifiers. |
| 27462 | 27486 | */ |
| 27463 | -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){ | |
| 27487 | +SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){ | |
| 27464 | 27488 | if( zLeft==0 ){ |
| 27465 | 27489 | return zRight ? -1 : 0; |
| 27466 | 27490 | }else if( zRight==0 ){ |
| 27467 | 27491 | return 1; |
| 27468 | 27492 | } |
| @@ -27479,11 +27503,11 @@ | ||
| 27479 | 27503 | a++; |
| 27480 | 27504 | b++; |
| 27481 | 27505 | } |
| 27482 | 27506 | return c; |
| 27483 | 27507 | } |
| 27484 | -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ | |
| 27508 | +SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ | |
| 27485 | 27509 | register unsigned char *a, *b; |
| 27486 | 27510 | if( zLeft==0 ){ |
| 27487 | 27511 | return zRight ? -1 : 0; |
| 27488 | 27512 | }else if( zRight==0 ){ |
| 27489 | 27513 | return 1; |
| @@ -36778,11 +36802,11 @@ | ||
| 36778 | 36802 | ** This routine is called once during SQLite initialization and by a |
| 36779 | 36803 | ** single thread. The memory allocation and mutex subsystems have not |
| 36780 | 36804 | ** necessarily been initialized when this routine is called, and so they |
| 36781 | 36805 | ** should not be used. |
| 36782 | 36806 | */ |
| 36783 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ | |
| 36807 | +SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){ | |
| 36784 | 36808 | /* |
| 36785 | 36809 | ** The following macro defines an initializer for an sqlite3_vfs object. |
| 36786 | 36810 | ** The name of the VFS is NAME. The pAppData is a pointer to a pointer |
| 36787 | 36811 | ** to the "finder" function. (pAppData is a pointer to a pointer because |
| 36788 | 36812 | ** silly C90 rules prohibit a void* from being cast to a function pointer |
| @@ -36877,11 +36901,11 @@ | ||
| 36877 | 36901 | ** |
| 36878 | 36902 | ** Some operating systems might need to do some cleanup in this routine, |
| 36879 | 36903 | ** to release dynamically allocated objects. But not on unix. |
| 36880 | 36904 | ** This routine is a no-op for unix. |
| 36881 | 36905 | */ |
| 36882 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ | |
| 36906 | +SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){ | |
| 36883 | 36907 | return SQLITE_OK; |
| 36884 | 36908 | } |
| 36885 | 36909 | |
| 36886 | 36910 | #endif /* SQLITE_OS_UNIX */ |
| 36887 | 36911 | |
| @@ -38312,11 +38336,11 @@ | ||
| 38312 | 38336 | ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one |
| 38313 | 38337 | ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The |
| 38314 | 38338 | ** "pnLargest" argument, if non-zero, will be used to return the size of the |
| 38315 | 38339 | ** largest committed free block in the heap, in bytes. |
| 38316 | 38340 | */ |
| 38317 | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){ | |
| 38341 | +SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){ | |
| 38318 | 38342 | int rc = SQLITE_OK; |
| 38319 | 38343 | UINT nLargest = 0; |
| 38320 | 38344 | HANDLE hHeap; |
| 38321 | 38345 | |
| 38322 | 38346 | winMemAssertMagic(); |
| @@ -38352,11 +38376,11 @@ | ||
| 38352 | 38376 | ** If a Win32 native heap has been configured, this function will attempt to |
| 38353 | 38377 | ** destroy and recreate it. If the Win32 native heap is not isolated and/or |
| 38354 | 38378 | ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will |
| 38355 | 38379 | ** be returned and no changes will be made to the Win32 native heap. |
| 38356 | 38380 | */ |
| 38357 | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){ | |
| 38381 | +SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){ | |
| 38358 | 38382 | int rc; |
| 38359 | 38383 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 38360 | 38384 | MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */ |
| 38361 | 38385 | MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) |
| 38362 | 38386 | MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); ) |
| @@ -38397,11 +38421,11 @@ | ||
| 38397 | 38421 | /* |
| 38398 | 38422 | ** This function outputs the specified (ANSI) string to the Win32 debugger |
| 38399 | 38423 | ** (if available). |
| 38400 | 38424 | */ |
| 38401 | 38425 | |
| 38402 | -SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){ | |
| 38426 | +SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){ | |
| 38403 | 38427 | char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE]; |
| 38404 | 38428 | int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */ |
| 38405 | 38429 | if( nMin<-1 ) nMin = -1; /* all negative values become -1. */ |
| 38406 | 38430 | assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE ); |
| 38407 | 38431 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -38443,11 +38467,11 @@ | ||
| 38443 | 38467 | */ |
| 38444 | 38468 | #if SQLITE_OS_WINRT |
| 38445 | 38469 | static HANDLE sleepObj = NULL; |
| 38446 | 38470 | #endif |
| 38447 | 38471 | |
| 38448 | -SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){ | |
| 38472 | +SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){ | |
| 38449 | 38473 | #if SQLITE_OS_WINRT |
| 38450 | 38474 | if ( sleepObj==NULL ){ |
| 38451 | 38475 | sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET, |
| 38452 | 38476 | SYNCHRONIZE); |
| 38453 | 38477 | } |
| @@ -38492,11 +38516,11 @@ | ||
| 38492 | 38516 | |
| 38493 | 38517 | /* |
| 38494 | 38518 | ** This function determines if the machine is running a version of Windows |
| 38495 | 38519 | ** based on the NT kernel. |
| 38496 | 38520 | */ |
| 38497 | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){ | |
| 38521 | +SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){ | |
| 38498 | 38522 | #if SQLITE_OS_WINRT |
| 38499 | 38523 | /* |
| 38500 | 38524 | ** NOTE: The WinRT sub-platform is always assumed to be based on the NT |
| 38501 | 38525 | ** kernel. |
| 38502 | 38526 | */ |
| @@ -38880,11 +38904,11 @@ | ||
| 38880 | 38904 | } |
| 38881 | 38905 | |
| 38882 | 38906 | /* |
| 38883 | 38907 | ** This is a public wrapper for the winUtf8ToUnicode() function. |
| 38884 | 38908 | */ |
| 38885 | -SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){ | |
| 38909 | +SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){ | |
| 38886 | 38910 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38887 | 38911 | if( !zText ){ |
| 38888 | 38912 | (void)SQLITE_MISUSE_BKPT; |
| 38889 | 38913 | return 0; |
| 38890 | 38914 | } |
| @@ -38896,11 +38920,11 @@ | ||
| 38896 | 38920 | } |
| 38897 | 38921 | |
| 38898 | 38922 | /* |
| 38899 | 38923 | ** This is a public wrapper for the winUnicodeToUtf8() function. |
| 38900 | 38924 | */ |
| 38901 | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ | |
| 38925 | +SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ | |
| 38902 | 38926 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38903 | 38927 | if( !zWideText ){ |
| 38904 | 38928 | (void)SQLITE_MISUSE_BKPT; |
| 38905 | 38929 | return 0; |
| 38906 | 38930 | } |
| @@ -38912,11 +38936,11 @@ | ||
| 38912 | 38936 | } |
| 38913 | 38937 | |
| 38914 | 38938 | /* |
| 38915 | 38939 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 38916 | 38940 | */ |
| 38917 | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){ | |
| 38941 | +SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){ | |
| 38918 | 38942 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38919 | 38943 | if( !zText ){ |
| 38920 | 38944 | (void)SQLITE_MISUSE_BKPT; |
| 38921 | 38945 | return 0; |
| 38922 | 38946 | } |
| @@ -38928,11 +38952,11 @@ | ||
| 38928 | 38952 | } |
| 38929 | 38953 | |
| 38930 | 38954 | /* |
| 38931 | 38955 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 38932 | 38956 | */ |
| 38933 | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){ | |
| 38957 | +SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){ | |
| 38934 | 38958 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38935 | 38959 | if( !zText ){ |
| 38936 | 38960 | (void)SQLITE_MISUSE_BKPT; |
| 38937 | 38961 | return 0; |
| 38938 | 38962 | } |
| @@ -38944,11 +38968,11 @@ | ||
| 38944 | 38968 | } |
| 38945 | 38969 | |
| 38946 | 38970 | /* |
| 38947 | 38971 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 38948 | 38972 | */ |
| 38949 | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){ | |
| 38973 | +SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){ | |
| 38950 | 38974 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38951 | 38975 | if( !zText ){ |
| 38952 | 38976 | (void)SQLITE_MISUSE_BKPT; |
| 38953 | 38977 | return 0; |
| 38954 | 38978 | } |
| @@ -38960,11 +38984,11 @@ | ||
| 38960 | 38984 | } |
| 38961 | 38985 | |
| 38962 | 38986 | /* |
| 38963 | 38987 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 38964 | 38988 | */ |
| 38965 | -SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){ | |
| 38989 | +SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){ | |
| 38966 | 38990 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38967 | 38991 | if( !zText ){ |
| 38968 | 38992 | (void)SQLITE_MISUSE_BKPT; |
| 38969 | 38993 | return 0; |
| 38970 | 38994 | } |
| @@ -38980,11 +39004,11 @@ | ||
| 38980 | 39004 | ** the provided arguments. The type argument must be 1 in order to set the |
| 38981 | 39005 | ** data directory or 2 in order to set the temporary directory. The zValue |
| 38982 | 39006 | ** argument is the name of the directory to use. The return value will be |
| 38983 | 39007 | ** SQLITE_OK if successful. |
| 38984 | 39008 | */ |
| 38985 | -SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){ | |
| 39009 | +SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){ | |
| 38986 | 39010 | char **ppDirectory = 0; |
| 38987 | 39011 | #ifndef SQLITE_OMIT_AUTOINIT |
| 38988 | 39012 | int rc = sqlite3_initialize(); |
| 38989 | 39013 | if( rc ) return rc; |
| 38990 | 39014 | #endif |
| @@ -42898,11 +42922,11 @@ | ||
| 42898 | 42922 | } |
| 42899 | 42923 | |
| 42900 | 42924 | /* |
| 42901 | 42925 | ** Initialize and deinitialize the operating system interface. |
| 42902 | 42926 | */ |
| 42903 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ | |
| 42927 | +SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){ | |
| 42904 | 42928 | static sqlite3_vfs winVfs = { |
| 42905 | 42929 | 3, /* iVersion */ |
| 42906 | 42930 | sizeof(winFile), /* szOsFile */ |
| 42907 | 42931 | SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */ |
| 42908 | 42932 | 0, /* pNext */ |
| @@ -43029,11 +43053,11 @@ | ||
| 43029 | 43053 | #endif |
| 43030 | 43054 | |
| 43031 | 43055 | return SQLITE_OK; |
| 43032 | 43056 | } |
| 43033 | 43057 | |
| 43034 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ | |
| 43058 | +SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){ | |
| 43035 | 43059 | #if SQLITE_OS_WINRT |
| 43036 | 43060 | if( sleepObj!=NULL ){ |
| 43037 | 43061 | osCloseHandle(sleepObj); |
| 43038 | 43062 | sleepObj = NULL; |
| 43039 | 43063 | } |
| @@ -57024,11 +57048,11 @@ | ||
| 57024 | 57048 | |
| 57025 | 57049 | /* |
| 57026 | 57050 | ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if |
| 57027 | 57051 | ** p1 is older than p2 and zero if p1 and p2 are the same snapshot. |
| 57028 | 57052 | */ |
| 57029 | -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){ | |
| 57053 | +SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){ | |
| 57030 | 57054 | WalIndexHdr *pHdr1 = (WalIndexHdr*)p1; |
| 57031 | 57055 | WalIndexHdr *pHdr2 = (WalIndexHdr*)p2; |
| 57032 | 57056 | |
| 57033 | 57057 | /* aSalt[0] is a copy of the value stored in the wal file header. It |
| 57034 | 57058 | ** is incremented each time the wal file is restarted. */ |
| @@ -58161,11 +58185,11 @@ | ||
| 58161 | 58185 | ** |
| 58162 | 58186 | ** This routine has no effect on existing database connections. |
| 58163 | 58187 | ** The shared cache setting effects only future calls to |
| 58164 | 58188 | ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2(). |
| 58165 | 58189 | */ |
| 58166 | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){ | |
| 58190 | +SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){ | |
| 58167 | 58191 | sqlite3GlobalConfig.sharedCacheEnabled = enable; |
| 58168 | 58192 | return SQLITE_OK; |
| 58169 | 58193 | } |
| 58170 | 58194 | #endif |
| 58171 | 58195 | |
| @@ -67934,11 +67958,11 @@ | ||
| 67934 | 67958 | ** a pointer to the new sqlite3_backup object. |
| 67935 | 67959 | ** |
| 67936 | 67960 | ** If an error occurs, NULL is returned and an error code and error message |
| 67937 | 67961 | ** stored in database handle pDestDb. |
| 67938 | 67962 | */ |
| 67939 | -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( | |
| 67963 | +SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init( | |
| 67940 | 67964 | sqlite3* pDestDb, /* Database to write to */ |
| 67941 | 67965 | const char *zDestDb, /* Name of database within pDestDb */ |
| 67942 | 67966 | sqlite3* pSrcDb, /* Database connection to read from */ |
| 67943 | 67967 | const char *zSrcDb /* Name of database within pSrcDb */ |
| 67944 | 67968 | ){ |
| @@ -68142,11 +68166,11 @@ | ||
| 68142 | 68166 | } |
| 68143 | 68167 | |
| 68144 | 68168 | /* |
| 68145 | 68169 | ** Copy nPage pages from the source b-tree to the destination. |
| 68146 | 68170 | */ |
| 68147 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){ | |
| 68171 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){ | |
| 68148 | 68172 | int rc; |
| 68149 | 68173 | int destMode; /* Destination journal mode */ |
| 68150 | 68174 | int pgszSrc = 0; /* Source page size */ |
| 68151 | 68175 | int pgszDest = 0; /* Destination page size */ |
| 68152 | 68176 | |
| @@ -68386,11 +68410,11 @@ | ||
| 68386 | 68410 | } |
| 68387 | 68411 | |
| 68388 | 68412 | /* |
| 68389 | 68413 | ** Release all resources associated with an sqlite3_backup* handle. |
| 68390 | 68414 | */ |
| 68391 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){ | |
| 68415 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){ | |
| 68392 | 68416 | sqlite3_backup **pp; /* Ptr to head of pagers backup list */ |
| 68393 | 68417 | sqlite3 *pSrcDb; /* Source database connection */ |
| 68394 | 68418 | int rc; /* Value to return */ |
| 68395 | 68419 | |
| 68396 | 68420 | /* Enter the mutexes */ |
| @@ -68438,11 +68462,11 @@ | ||
| 68438 | 68462 | |
| 68439 | 68463 | /* |
| 68440 | 68464 | ** Return the number of pages still to be backed up as of the most recent |
| 68441 | 68465 | ** call to sqlite3_backup_step(). |
| 68442 | 68466 | */ |
| 68443 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){ | |
| 68467 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){ | |
| 68444 | 68468 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68445 | 68469 | if( p==0 ){ |
| 68446 | 68470 | (void)SQLITE_MISUSE_BKPT; |
| 68447 | 68471 | return 0; |
| 68448 | 68472 | } |
| @@ -68452,11 +68476,11 @@ | ||
| 68452 | 68476 | |
| 68453 | 68477 | /* |
| 68454 | 68478 | ** Return the total number of pages in the source database as of the most |
| 68455 | 68479 | ** recent call to sqlite3_backup_step(). |
| 68456 | 68480 | */ |
| 68457 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){ | |
| 68481 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){ | |
| 68458 | 68482 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68459 | 68483 | if( p==0 ){ |
| 68460 | 68484 | (void)SQLITE_MISUSE_BKPT; |
| 68461 | 68485 | return 0; |
| 68462 | 68486 | } |
| @@ -74906,11 +74930,11 @@ | ||
| 74906 | 74930 | ** execution environment changes in a way that would alter the program |
| 74907 | 74931 | ** that sqlite3_prepare() generates. For example, if new functions or |
| 74908 | 74932 | ** collating sequences are registered or if an authorizer function is |
| 74909 | 74933 | ** added or changed. |
| 74910 | 74934 | */ |
| 74911 | -SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){ | |
| 74935 | +SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){ | |
| 74912 | 74936 | Vdbe *p = (Vdbe*)pStmt; |
| 74913 | 74937 | return p==0 || p->expired; |
| 74914 | 74938 | } |
| 74915 | 74939 | #endif |
| 74916 | 74940 | |
| @@ -74975,11 +74999,11 @@ | ||
| 74975 | 74999 | ** machine. |
| 74976 | 75000 | ** |
| 74977 | 75001 | ** This routine sets the error code and string returned by |
| 74978 | 75002 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 74979 | 75003 | */ |
| 74980 | -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){ | |
| 75004 | +SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){ | |
| 74981 | 75005 | int rc; |
| 74982 | 75006 | if( pStmt==0 ){ |
| 74983 | 75007 | /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL |
| 74984 | 75008 | ** pointer is a harmless no-op. */ |
| 74985 | 75009 | rc = SQLITE_OK; |
| @@ -75002,11 +75026,11 @@ | ||
| 75002 | 75026 | ** the prior execution is returned. |
| 75003 | 75027 | ** |
| 75004 | 75028 | ** This routine sets the error code and string returned by |
| 75005 | 75029 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 75006 | 75030 | */ |
| 75007 | -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){ | |
| 75031 | +SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){ | |
| 75008 | 75032 | int rc; |
| 75009 | 75033 | if( pStmt==0 ){ |
| 75010 | 75034 | rc = SQLITE_OK; |
| 75011 | 75035 | }else{ |
| 75012 | 75036 | Vdbe *v = (Vdbe*)pStmt; |
| @@ -75023,11 +75047,11 @@ | ||
| 75023 | 75047 | } |
| 75024 | 75048 | |
| 75025 | 75049 | /* |
| 75026 | 75050 | ** Set all the parameters in the compiled SQL statement to NULL. |
| 75027 | 75051 | */ |
| 75028 | -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){ | |
| 75052 | +SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){ | |
| 75029 | 75053 | int i; |
| 75030 | 75054 | int rc = SQLITE_OK; |
| 75031 | 75055 | Vdbe *p = (Vdbe*)pStmt; |
| 75032 | 75056 | #if SQLITE_THREADSAFE |
| 75033 | 75057 | sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex; |
| @@ -75047,11 +75071,11 @@ | ||
| 75047 | 75071 | |
| 75048 | 75072 | /**************************** sqlite3_value_ ******************************* |
| 75049 | 75073 | ** The following routines extract information from a Mem or sqlite3_value |
| 75050 | 75074 | ** structure. |
| 75051 | 75075 | */ |
| 75052 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){ | |
| 75076 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){ | |
| 75053 | 75077 | Mem *p = (Mem*)pVal; |
| 75054 | 75078 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 75055 | 75079 | if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){ |
| 75056 | 75080 | assert( p->flags==MEM_Null && p->z==0 ); |
| 75057 | 75081 | return 0; |
| @@ -75060,48 +75084,48 @@ | ||
| 75060 | 75084 | return p->n ? p->z : 0; |
| 75061 | 75085 | }else{ |
| 75062 | 75086 | return sqlite3_value_text(pVal); |
| 75063 | 75087 | } |
| 75064 | 75088 | } |
| 75065 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){ | |
| 75089 | +SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){ | |
| 75066 | 75090 | return sqlite3ValueBytes(pVal, SQLITE_UTF8); |
| 75067 | 75091 | } |
| 75068 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){ | |
| 75092 | +SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){ | |
| 75069 | 75093 | return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE); |
| 75070 | 75094 | } |
| 75071 | -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){ | |
| 75095 | +SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){ | |
| 75072 | 75096 | return sqlite3VdbeRealValue((Mem*)pVal); |
| 75073 | 75097 | } |
| 75074 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){ | |
| 75098 | +SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){ | |
| 75075 | 75099 | return (int)sqlite3VdbeIntValue((Mem*)pVal); |
| 75076 | 75100 | } |
| 75077 | -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){ | |
| 75101 | +SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){ | |
| 75078 | 75102 | return sqlite3VdbeIntValue((Mem*)pVal); |
| 75079 | 75103 | } |
| 75080 | -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){ | |
| 75104 | +SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){ | |
| 75081 | 75105 | Mem *pMem = (Mem*)pVal; |
| 75082 | 75106 | return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0); |
| 75083 | 75107 | } |
| 75084 | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){ | |
| 75108 | +SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){ | |
| 75085 | 75109 | return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8); |
| 75086 | 75110 | } |
| 75087 | 75111 | #ifndef SQLITE_OMIT_UTF16 |
| 75088 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){ | |
| 75112 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){ | |
| 75089 | 75113 | return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE); |
| 75090 | 75114 | } |
| 75091 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){ | |
| 75115 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){ | |
| 75092 | 75116 | return sqlite3ValueText(pVal, SQLITE_UTF16BE); |
| 75093 | 75117 | } |
| 75094 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){ | |
| 75118 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){ | |
| 75095 | 75119 | return sqlite3ValueText(pVal, SQLITE_UTF16LE); |
| 75096 | 75120 | } |
| 75097 | 75121 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75098 | 75122 | /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five |
| 75099 | 75123 | ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating |
| 75100 | 75124 | ** point number string BLOB NULL |
| 75101 | 75125 | */ |
| 75102 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){ | |
| 75126 | +SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){ | |
| 75103 | 75127 | static const u8 aType[] = { |
| 75104 | 75128 | SQLITE_BLOB, /* 0x00 */ |
| 75105 | 75129 | SQLITE_NULL, /* 0x01 */ |
| 75106 | 75130 | SQLITE_TEXT, /* 0x02 */ |
| 75107 | 75131 | SQLITE_NULL, /* 0x03 */ |
| @@ -75137,11 +75161,11 @@ | ||
| 75137 | 75161 | return aType[pVal->flags&MEM_AffMask]; |
| 75138 | 75162 | } |
| 75139 | 75163 | |
| 75140 | 75164 | /* Make a copy of an sqlite3_value object |
| 75141 | 75165 | */ |
| 75142 | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){ | |
| 75166 | +SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){ | |
| 75143 | 75167 | sqlite3_value *pNew; |
| 75144 | 75168 | if( pOrig==0 ) return 0; |
| 75145 | 75169 | pNew = sqlite3_malloc( sizeof(*pNew) ); |
| 75146 | 75170 | if( pNew==0 ) return 0; |
| 75147 | 75171 | memset(pNew, 0, sizeof(*pNew)); |
| @@ -75160,11 +75184,11 @@ | ||
| 75160 | 75184 | } |
| 75161 | 75185 | |
| 75162 | 75186 | /* Destroy an sqlite3_value object previously obtained from |
| 75163 | 75187 | ** sqlite3_value_dup(). |
| 75164 | 75188 | */ |
| 75165 | -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){ | |
| 75189 | +SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){ | |
| 75166 | 75190 | sqlite3ValueFree(pOld); |
| 75167 | 75191 | } |
| 75168 | 75192 | |
| 75169 | 75193 | |
| 75170 | 75194 | /**************************** sqlite3_result_ ******************************* |
| @@ -75203,21 +75227,21 @@ | ||
| 75203 | 75227 | xDel((void*)p); |
| 75204 | 75228 | } |
| 75205 | 75229 | if( pCtx ) sqlite3_result_error_toobig(pCtx); |
| 75206 | 75230 | return SQLITE_TOOBIG; |
| 75207 | 75231 | } |
| 75208 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob( | |
| 75232 | +SQLITE_API void SQLITE_APICALL sqlite3_result_blob( | |
| 75209 | 75233 | sqlite3_context *pCtx, |
| 75210 | 75234 | const void *z, |
| 75211 | 75235 | int n, |
| 75212 | 75236 | void (*xDel)(void *) |
| 75213 | 75237 | ){ |
| 75214 | 75238 | assert( n>=0 ); |
| 75215 | 75239 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75216 | 75240 | setResultStrOrError(pCtx, z, n, 0, xDel); |
| 75217 | 75241 | } |
| 75218 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64( | |
| 75242 | +SQLITE_API void SQLITE_APICALL sqlite3_result_blob64( | |
| 75219 | 75243 | sqlite3_context *pCtx, |
| 75220 | 75244 | const void *z, |
| 75221 | 75245 | sqlite3_uint64 n, |
| 75222 | 75246 | void (*xDel)(void *) |
| 75223 | 75247 | ){ |
| @@ -75227,56 +75251,56 @@ | ||
| 75227 | 75251 | (void)invokeValueDestructor(z, xDel, pCtx); |
| 75228 | 75252 | }else{ |
| 75229 | 75253 | setResultStrOrError(pCtx, z, (int)n, 0, xDel); |
| 75230 | 75254 | } |
| 75231 | 75255 | } |
| 75232 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){ | |
| 75256 | +SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){ | |
| 75233 | 75257 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75234 | 75258 | sqlite3VdbeMemSetDouble(pCtx->pOut, rVal); |
| 75235 | 75259 | } |
| 75236 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ | |
| 75260 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ | |
| 75237 | 75261 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75238 | 75262 | pCtx->isError = SQLITE_ERROR; |
| 75239 | 75263 | pCtx->fErrorOrAux = 1; |
| 75240 | 75264 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT); |
| 75241 | 75265 | } |
| 75242 | 75266 | #ifndef SQLITE_OMIT_UTF16 |
| 75243 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ | |
| 75267 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ | |
| 75244 | 75268 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75245 | 75269 | pCtx->isError = SQLITE_ERROR; |
| 75246 | 75270 | pCtx->fErrorOrAux = 1; |
| 75247 | 75271 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT); |
| 75248 | 75272 | } |
| 75249 | 75273 | #endif |
| 75250 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){ | |
| 75274 | +SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){ | |
| 75251 | 75275 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75252 | 75276 | sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal); |
| 75253 | 75277 | } |
| 75254 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ | |
| 75278 | +SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ | |
| 75255 | 75279 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75256 | 75280 | sqlite3VdbeMemSetInt64(pCtx->pOut, iVal); |
| 75257 | 75281 | } |
| 75258 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){ | |
| 75282 | +SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){ | |
| 75259 | 75283 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75260 | 75284 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75261 | 75285 | } |
| 75262 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ | |
| 75286 | +SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ | |
| 75263 | 75287 | Mem *pOut = pCtx->pOut; |
| 75264 | 75288 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75265 | 75289 | pOut->eSubtype = eSubtype & 0xff; |
| 75266 | 75290 | pOut->flags |= MEM_Subtype; |
| 75267 | 75291 | } |
| 75268 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text( | |
| 75292 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text( | |
| 75269 | 75293 | sqlite3_context *pCtx, |
| 75270 | 75294 | const char *z, |
| 75271 | 75295 | int n, |
| 75272 | 75296 | void (*xDel)(void *) |
| 75273 | 75297 | ){ |
| 75274 | 75298 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75275 | 75299 | setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel); |
| 75276 | 75300 | } |
| 75277 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64( | |
| 75301 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text64( | |
| 75278 | 75302 | sqlite3_context *pCtx, |
| 75279 | 75303 | const char *z, |
| 75280 | 75304 | sqlite3_uint64 n, |
| 75281 | 75305 | void (*xDel)(void *), |
| 75282 | 75306 | unsigned char enc |
| @@ -75289,56 +75313,56 @@ | ||
| 75289 | 75313 | }else{ |
| 75290 | 75314 | setResultStrOrError(pCtx, z, (int)n, enc, xDel); |
| 75291 | 75315 | } |
| 75292 | 75316 | } |
| 75293 | 75317 | #ifndef SQLITE_OMIT_UTF16 |
| 75294 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16( | |
| 75318 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16( | |
| 75295 | 75319 | sqlite3_context *pCtx, |
| 75296 | 75320 | const void *z, |
| 75297 | 75321 | int n, |
| 75298 | 75322 | void (*xDel)(void *) |
| 75299 | 75323 | ){ |
| 75300 | 75324 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75301 | 75325 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel); |
| 75302 | 75326 | } |
| 75303 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be( | |
| 75327 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16be( | |
| 75304 | 75328 | sqlite3_context *pCtx, |
| 75305 | 75329 | const void *z, |
| 75306 | 75330 | int n, |
| 75307 | 75331 | void (*xDel)(void *) |
| 75308 | 75332 | ){ |
| 75309 | 75333 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75310 | 75334 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel); |
| 75311 | 75335 | } |
| 75312 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le( | |
| 75336 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16le( | |
| 75313 | 75337 | sqlite3_context *pCtx, |
| 75314 | 75338 | const void *z, |
| 75315 | 75339 | int n, |
| 75316 | 75340 | void (*xDel)(void *) |
| 75317 | 75341 | ){ |
| 75318 | 75342 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75319 | 75343 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel); |
| 75320 | 75344 | } |
| 75321 | 75345 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75322 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ | |
| 75346 | +SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ | |
| 75323 | 75347 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75324 | 75348 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 75325 | 75349 | } |
| 75326 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ | |
| 75350 | +SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ | |
| 75327 | 75351 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75328 | 75352 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 75329 | 75353 | } |
| 75330 | -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ | |
| 75354 | +SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ | |
| 75331 | 75355 | Mem *pOut = pCtx->pOut; |
| 75332 | 75356 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75333 | 75357 | if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 75334 | 75358 | return SQLITE_TOOBIG; |
| 75335 | 75359 | } |
| 75336 | 75360 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n); |
| 75337 | 75361 | return SQLITE_OK; |
| 75338 | 75362 | } |
| 75339 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ | |
| 75363 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ | |
| 75340 | 75364 | pCtx->isError = errCode; |
| 75341 | 75365 | pCtx->fErrorOrAux = 1; |
| 75342 | 75366 | #ifdef SQLITE_DEBUG |
| 75343 | 75367 | if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode; |
| 75344 | 75368 | #endif |
| @@ -75347,20 +75371,20 @@ | ||
| 75347 | 75371 | SQLITE_UTF8, SQLITE_STATIC); |
| 75348 | 75372 | } |
| 75349 | 75373 | } |
| 75350 | 75374 | |
| 75351 | 75375 | /* Force an SQLITE_TOOBIG error. */ |
| 75352 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){ | |
| 75376 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){ | |
| 75353 | 75377 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75354 | 75378 | pCtx->isError = SQLITE_TOOBIG; |
| 75355 | 75379 | pCtx->fErrorOrAux = 1; |
| 75356 | 75380 | sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, |
| 75357 | 75381 | SQLITE_UTF8, SQLITE_STATIC); |
| 75358 | 75382 | } |
| 75359 | 75383 | |
| 75360 | 75384 | /* An SQLITE_NOMEM error. */ |
| 75361 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){ | |
| 75385 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){ | |
| 75362 | 75386 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75363 | 75387 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75364 | 75388 | pCtx->isError = SQLITE_NOMEM_BKPT; |
| 75365 | 75389 | pCtx->fErrorOrAux = 1; |
| 75366 | 75390 | sqlite3OomFault(pCtx->pOut->db); |
| @@ -75528,11 +75552,11 @@ | ||
| 75528 | 75552 | /* |
| 75529 | 75553 | ** This is the top-level implementation of sqlite3_step(). Call |
| 75530 | 75554 | ** sqlite3Step() to do most of the work. If a schema error occurs, |
| 75531 | 75555 | ** call sqlite3Reprepare() and try again. |
| 75532 | 75556 | */ |
| 75533 | -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){ | |
| 75557 | +SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){ | |
| 75534 | 75558 | int rc = SQLITE_OK; /* Result from sqlite3Step() */ |
| 75535 | 75559 | int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */ |
| 75536 | 75560 | Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */ |
| 75537 | 75561 | int cnt = 0; /* Counter to prevent infinite loop of reprepares */ |
| 75538 | 75562 | sqlite3 *db; /* The database connection */ |
| @@ -75579,11 +75603,11 @@ | ||
| 75579 | 75603 | |
| 75580 | 75604 | /* |
| 75581 | 75605 | ** Extract the user data from a sqlite3_context structure and return a |
| 75582 | 75606 | ** pointer to it. |
| 75583 | 75607 | */ |
| 75584 | -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){ | |
| 75608 | +SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){ | |
| 75585 | 75609 | assert( p && p->pFunc ); |
| 75586 | 75610 | return p->pFunc->pUserData; |
| 75587 | 75611 | } |
| 75588 | 75612 | |
| 75589 | 75613 | /* |
| @@ -75594,11 +75618,11 @@ | ||
| 75594 | 75618 | ** returns a copy of the pointer to the database connection (the 1st |
| 75595 | 75619 | ** parameter) of the sqlite3_create_function() and |
| 75596 | 75620 | ** sqlite3_create_function16() routines that originally registered the |
| 75597 | 75621 | ** application defined function. |
| 75598 | 75622 | */ |
| 75599 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){ | |
| 75623 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){ | |
| 75600 | 75624 | assert( p && p->pOut ); |
| 75601 | 75625 | return p->pOut->db; |
| 75602 | 75626 | } |
| 75603 | 75627 | |
| 75604 | 75628 | /* |
| @@ -75670,11 +75694,11 @@ | ||
| 75670 | 75694 | /* |
| 75671 | 75695 | ** Allocate or return the aggregate context for a user function. A new |
| 75672 | 75696 | ** context is allocated on the first call. Subsequent calls return the |
| 75673 | 75697 | ** same context that was returned on prior calls. |
| 75674 | 75698 | */ |
| 75675 | -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){ | |
| 75699 | +SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){ | |
| 75676 | 75700 | assert( p && p->pFunc && p->pFunc->xFinalize ); |
| 75677 | 75701 | assert( sqlite3_mutex_held(p->pOut->db->mutex) ); |
| 75678 | 75702 | testcase( nByte<0 ); |
| 75679 | 75703 | if( (p->pMem->flags & MEM_Agg)==0 ){ |
| 75680 | 75704 | return createAggContext(p, nByte); |
| @@ -75685,11 +75709,11 @@ | ||
| 75685 | 75709 | |
| 75686 | 75710 | /* |
| 75687 | 75711 | ** Return the auxiliary data pointer, if any, for the iArg'th argument to |
| 75688 | 75712 | ** the user-function defined by pCtx. |
| 75689 | 75713 | */ |
| 75690 | -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ | |
| 75714 | +SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ | |
| 75691 | 75715 | AuxData *pAuxData; |
| 75692 | 75716 | |
| 75693 | 75717 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75694 | 75718 | #if SQLITE_ENABLE_STAT3_OR_STAT4 |
| 75695 | 75719 | if( pCtx->pVdbe==0 ) return 0; |
| @@ -75706,11 +75730,11 @@ | ||
| 75706 | 75730 | /* |
| 75707 | 75731 | ** Set the auxiliary data pointer and delete function, for the iArg'th |
| 75708 | 75732 | ** argument to the user-function defined by pCtx. Any previous value is |
| 75709 | 75733 | ** deleted by calling the delete function specified when it was set. |
| 75710 | 75734 | */ |
| 75711 | -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata( | |
| 75735 | +SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata( | |
| 75712 | 75736 | sqlite3_context *pCtx, |
| 75713 | 75737 | int iArg, |
| 75714 | 75738 | void *pAux, |
| 75715 | 75739 | void (*xDelete)(void*) |
| 75716 | 75740 | ){ |
| @@ -75761,29 +75785,29 @@ | ||
| 75761 | 75785 | ** This function is deprecated. Do not use it for new code. It is |
| 75762 | 75786 | ** provide only to avoid breaking legacy code. New aggregate function |
| 75763 | 75787 | ** implementations should keep their own counts within their aggregate |
| 75764 | 75788 | ** context. |
| 75765 | 75789 | */ |
| 75766 | -SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){ | |
| 75790 | +SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){ | |
| 75767 | 75791 | assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize ); |
| 75768 | 75792 | return p->pMem->n; |
| 75769 | 75793 | } |
| 75770 | 75794 | #endif |
| 75771 | 75795 | |
| 75772 | 75796 | /* |
| 75773 | 75797 | ** Return the number of columns in the result set for the statement pStmt. |
| 75774 | 75798 | */ |
| 75775 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){ | |
| 75799 | +SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){ | |
| 75776 | 75800 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75777 | 75801 | return pVm ? pVm->nResColumn : 0; |
| 75778 | 75802 | } |
| 75779 | 75803 | |
| 75780 | 75804 | /* |
| 75781 | 75805 | ** Return the number of values available from the current row of the |
| 75782 | 75806 | ** currently executing statement pStmt. |
| 75783 | 75807 | */ |
| 75784 | -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){ | |
| 75808 | +SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){ | |
| 75785 | 75809 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75786 | 75810 | if( pVm==0 || pVm->pResultSet==0 ) return 0; |
| 75787 | 75811 | return pVm->nResColumn; |
| 75788 | 75812 | } |
| 75789 | 75813 | |
| @@ -75882,67 +75906,67 @@ | ||
| 75882 | 75906 | |
| 75883 | 75907 | /**************************** sqlite3_column_ ******************************* |
| 75884 | 75908 | ** The following routines are used to access elements of the current row |
| 75885 | 75909 | ** in the result set. |
| 75886 | 75910 | */ |
| 75887 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ | |
| 75911 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ | |
| 75888 | 75912 | const void *val; |
| 75889 | 75913 | val = sqlite3_value_blob( columnMem(pStmt,i) ); |
| 75890 | 75914 | /* Even though there is no encoding conversion, value_blob() might |
| 75891 | 75915 | ** need to call malloc() to expand the result of a zeroblob() |
| 75892 | 75916 | ** expression. |
| 75893 | 75917 | */ |
| 75894 | 75918 | columnMallocFailure(pStmt); |
| 75895 | 75919 | return val; |
| 75896 | 75920 | } |
| 75897 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ | |
| 75921 | +SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ | |
| 75898 | 75922 | int val = sqlite3_value_bytes( columnMem(pStmt,i) ); |
| 75899 | 75923 | columnMallocFailure(pStmt); |
| 75900 | 75924 | return val; |
| 75901 | 75925 | } |
| 75902 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ | |
| 75926 | +SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ | |
| 75903 | 75927 | int val = sqlite3_value_bytes16( columnMem(pStmt,i) ); |
| 75904 | 75928 | columnMallocFailure(pStmt); |
| 75905 | 75929 | return val; |
| 75906 | 75930 | } |
| 75907 | -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){ | |
| 75931 | +SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){ | |
| 75908 | 75932 | double val = sqlite3_value_double( columnMem(pStmt,i) ); |
| 75909 | 75933 | columnMallocFailure(pStmt); |
| 75910 | 75934 | return val; |
| 75911 | 75935 | } |
| 75912 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){ | |
| 75936 | +SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){ | |
| 75913 | 75937 | int val = sqlite3_value_int( columnMem(pStmt,i) ); |
| 75914 | 75938 | columnMallocFailure(pStmt); |
| 75915 | 75939 | return val; |
| 75916 | 75940 | } |
| 75917 | -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ | |
| 75941 | +SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ | |
| 75918 | 75942 | sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) ); |
| 75919 | 75943 | columnMallocFailure(pStmt); |
| 75920 | 75944 | return val; |
| 75921 | 75945 | } |
| 75922 | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){ | |
| 75946 | +SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){ | |
| 75923 | 75947 | const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) ); |
| 75924 | 75948 | columnMallocFailure(pStmt); |
| 75925 | 75949 | return val; |
| 75926 | 75950 | } |
| 75927 | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){ | |
| 75951 | +SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){ | |
| 75928 | 75952 | Mem *pOut = columnMem(pStmt, i); |
| 75929 | 75953 | if( pOut->flags&MEM_Static ){ |
| 75930 | 75954 | pOut->flags &= ~MEM_Static; |
| 75931 | 75955 | pOut->flags |= MEM_Ephem; |
| 75932 | 75956 | } |
| 75933 | 75957 | columnMallocFailure(pStmt); |
| 75934 | 75958 | return (sqlite3_value *)pOut; |
| 75935 | 75959 | } |
| 75936 | 75960 | #ifndef SQLITE_OMIT_UTF16 |
| 75937 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ | |
| 75961 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ | |
| 75938 | 75962 | const void *val = sqlite3_value_text16( columnMem(pStmt,i) ); |
| 75939 | 75963 | columnMallocFailure(pStmt); |
| 75940 | 75964 | return val; |
| 75941 | 75965 | } |
| 75942 | 75966 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75943 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){ | |
| 75967 | +SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){ | |
| 75944 | 75968 | int iType = sqlite3_value_type( columnMem(pStmt,i) ); |
| 75945 | 75969 | columnMallocFailure(pStmt); |
| 75946 | 75970 | return iType; |
| 75947 | 75971 | } |
| 75948 | 75972 | |
| @@ -76002,16 +76026,16 @@ | ||
| 76002 | 76026 | |
| 76003 | 76027 | /* |
| 76004 | 76028 | ** Return the name of the Nth column of the result set returned by SQL |
| 76005 | 76029 | ** statement pStmt. |
| 76006 | 76030 | */ |
| 76007 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){ | |
| 76031 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){ | |
| 76008 | 76032 | return columnName( |
| 76009 | 76033 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME); |
| 76010 | 76034 | } |
| 76011 | 76035 | #ifndef SQLITE_OMIT_UTF16 |
| 76012 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ | |
| 76036 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ | |
| 76013 | 76037 | return columnName( |
| 76014 | 76038 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME); |
| 76015 | 76039 | } |
| 76016 | 76040 | #endif |
| 76017 | 76041 | |
| @@ -76027,16 +76051,16 @@ | ||
| 76027 | 76051 | #ifndef SQLITE_OMIT_DECLTYPE |
| 76028 | 76052 | /* |
| 76029 | 76053 | ** Return the column declaration type (if applicable) of the 'i'th column |
| 76030 | 76054 | ** of the result set of SQL statement pStmt. |
| 76031 | 76055 | */ |
| 76032 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ | |
| 76056 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ | |
| 76033 | 76057 | return columnName( |
| 76034 | 76058 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE); |
| 76035 | 76059 | } |
| 76036 | 76060 | #ifndef SQLITE_OMIT_UTF16 |
| 76037 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ | |
| 76061 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ | |
| 76038 | 76062 | return columnName( |
| 76039 | 76063 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE); |
| 76040 | 76064 | } |
| 76041 | 76065 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76042 | 76066 | #endif /* SQLITE_OMIT_DECLTYPE */ |
| @@ -76045,16 +76069,16 @@ | ||
| 76045 | 76069 | /* |
| 76046 | 76070 | ** Return the name of the database from which a result column derives. |
| 76047 | 76071 | ** NULL is returned if the result column is an expression or constant or |
| 76048 | 76072 | ** anything else which is not an unambiguous reference to a database column. |
| 76049 | 76073 | */ |
| 76050 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ | |
| 76074 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ | |
| 76051 | 76075 | return columnName( |
| 76052 | 76076 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE); |
| 76053 | 76077 | } |
| 76054 | 76078 | #ifndef SQLITE_OMIT_UTF16 |
| 76055 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ | |
| 76079 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ | |
| 76056 | 76080 | return columnName( |
| 76057 | 76081 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE); |
| 76058 | 76082 | } |
| 76059 | 76083 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76060 | 76084 | |
| @@ -76061,16 +76085,16 @@ | ||
| 76061 | 76085 | /* |
| 76062 | 76086 | ** Return the name of the table from which a result column derives. |
| 76063 | 76087 | ** NULL is returned if the result column is an expression or constant or |
| 76064 | 76088 | ** anything else which is not an unambiguous reference to a database column. |
| 76065 | 76089 | */ |
| 76066 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ | |
| 76090 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ | |
| 76067 | 76091 | return columnName( |
| 76068 | 76092 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE); |
| 76069 | 76093 | } |
| 76070 | 76094 | #ifndef SQLITE_OMIT_UTF16 |
| 76071 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ | |
| 76095 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ | |
| 76072 | 76096 | return columnName( |
| 76073 | 76097 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE); |
| 76074 | 76098 | } |
| 76075 | 76099 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76076 | 76100 | |
| @@ -76077,16 +76101,16 @@ | ||
| 76077 | 76101 | /* |
| 76078 | 76102 | ** Return the name of the table column from which a result column derives. |
| 76079 | 76103 | ** NULL is returned if the result column is an expression or constant or |
| 76080 | 76104 | ** anything else which is not an unambiguous reference to a database column. |
| 76081 | 76105 | */ |
| 76082 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ | |
| 76106 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ | |
| 76083 | 76107 | return columnName( |
| 76084 | 76108 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN); |
| 76085 | 76109 | } |
| 76086 | 76110 | #ifndef SQLITE_OMIT_UTF16 |
| 76087 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ | |
| 76111 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ | |
| 76088 | 76112 | return columnName( |
| 76089 | 76113 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN); |
| 76090 | 76114 | } |
| 76091 | 76115 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76092 | 76116 | #endif /* SQLITE_ENABLE_COLUMN_METADATA */ |
| @@ -76183,11 +76207,11 @@ | ||
| 76183 | 76207 | |
| 76184 | 76208 | |
| 76185 | 76209 | /* |
| 76186 | 76210 | ** Bind a blob value to an SQL statement variable. |
| 76187 | 76211 | */ |
| 76188 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob( | |
| 76212 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_blob( | |
| 76189 | 76213 | sqlite3_stmt *pStmt, |
| 76190 | 76214 | int i, |
| 76191 | 76215 | const void *zData, |
| 76192 | 76216 | int nData, |
| 76193 | 76217 | void (*xDel)(void*) |
| @@ -76195,11 +76219,11 @@ | ||
| 76195 | 76219 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76196 | 76220 | if( nData<0 ) return SQLITE_MISUSE_BKPT; |
| 76197 | 76221 | #endif |
| 76198 | 76222 | return bindText(pStmt, i, zData, nData, xDel, 0); |
| 76199 | 76223 | } |
| 76200 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64( | |
| 76224 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64( | |
| 76201 | 76225 | sqlite3_stmt *pStmt, |
| 76202 | 76226 | int i, |
| 76203 | 76227 | const void *zData, |
| 76204 | 76228 | sqlite3_uint64 nData, |
| 76205 | 76229 | void (*xDel)(void*) |
| @@ -76209,52 +76233,52 @@ | ||
| 76209 | 76233 | return invokeValueDestructor(zData, xDel, 0); |
| 76210 | 76234 | }else{ |
| 76211 | 76235 | return bindText(pStmt, i, zData, (int)nData, xDel, 0); |
| 76212 | 76236 | } |
| 76213 | 76237 | } |
| 76214 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ | |
| 76238 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ | |
| 76215 | 76239 | int rc; |
| 76216 | 76240 | Vdbe *p = (Vdbe *)pStmt; |
| 76217 | 76241 | rc = vdbeUnbind(p, i); |
| 76218 | 76242 | if( rc==SQLITE_OK ){ |
| 76219 | 76243 | sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue); |
| 76220 | 76244 | sqlite3_mutex_leave(p->db->mutex); |
| 76221 | 76245 | } |
| 76222 | 76246 | return rc; |
| 76223 | 76247 | } |
| 76224 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ | |
| 76248 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ | |
| 76225 | 76249 | return sqlite3_bind_int64(p, i, (i64)iValue); |
| 76226 | 76250 | } |
| 76227 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ | |
| 76251 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ | |
| 76228 | 76252 | int rc; |
| 76229 | 76253 | Vdbe *p = (Vdbe *)pStmt; |
| 76230 | 76254 | rc = vdbeUnbind(p, i); |
| 76231 | 76255 | if( rc==SQLITE_OK ){ |
| 76232 | 76256 | sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue); |
| 76233 | 76257 | sqlite3_mutex_leave(p->db->mutex); |
| 76234 | 76258 | } |
| 76235 | 76259 | return rc; |
| 76236 | 76260 | } |
| 76237 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){ | |
| 76261 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){ | |
| 76238 | 76262 | int rc; |
| 76239 | 76263 | Vdbe *p = (Vdbe*)pStmt; |
| 76240 | 76264 | rc = vdbeUnbind(p, i); |
| 76241 | 76265 | if( rc==SQLITE_OK ){ |
| 76242 | 76266 | sqlite3_mutex_leave(p->db->mutex); |
| 76243 | 76267 | } |
| 76244 | 76268 | return rc; |
| 76245 | 76269 | } |
| 76246 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text( | |
| 76270 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text( | |
| 76247 | 76271 | sqlite3_stmt *pStmt, |
| 76248 | 76272 | int i, |
| 76249 | 76273 | const char *zData, |
| 76250 | 76274 | int nData, |
| 76251 | 76275 | void (*xDel)(void*) |
| 76252 | 76276 | ){ |
| 76253 | 76277 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); |
| 76254 | 76278 | } |
| 76255 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64( | |
| 76279 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text64( | |
| 76256 | 76280 | sqlite3_stmt *pStmt, |
| 76257 | 76281 | int i, |
| 76258 | 76282 | const char *zData, |
| 76259 | 76283 | sqlite3_uint64 nData, |
| 76260 | 76284 | void (*xDel)(void*), |
| @@ -76267,21 +76291,21 @@ | ||
| 76267 | 76291 | if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
| 76268 | 76292 | return bindText(pStmt, i, zData, (int)nData, xDel, enc); |
| 76269 | 76293 | } |
| 76270 | 76294 | } |
| 76271 | 76295 | #ifndef SQLITE_OMIT_UTF16 |
| 76272 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16( | |
| 76296 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text16( | |
| 76273 | 76297 | sqlite3_stmt *pStmt, |
| 76274 | 76298 | int i, |
| 76275 | 76299 | const void *zData, |
| 76276 | 76300 | int nData, |
| 76277 | 76301 | void (*xDel)(void*) |
| 76278 | 76302 | ){ |
| 76279 | 76303 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); |
| 76280 | 76304 | } |
| 76281 | 76305 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76282 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ | |
| 76306 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ | |
| 76283 | 76307 | int rc; |
| 76284 | 76308 | switch( sqlite3_value_type((sqlite3_value*)pValue) ){ |
| 76285 | 76309 | case SQLITE_INTEGER: { |
| 76286 | 76310 | rc = sqlite3_bind_int64(pStmt, i, pValue->u.i); |
| 76287 | 76311 | break; |
| @@ -76308,21 +76332,21 @@ | ||
| 76308 | 76332 | break; |
| 76309 | 76333 | } |
| 76310 | 76334 | } |
| 76311 | 76335 | return rc; |
| 76312 | 76336 | } |
| 76313 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){ | |
| 76337 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){ | |
| 76314 | 76338 | int rc; |
| 76315 | 76339 | Vdbe *p = (Vdbe *)pStmt; |
| 76316 | 76340 | rc = vdbeUnbind(p, i); |
| 76317 | 76341 | if( rc==SQLITE_OK ){ |
| 76318 | 76342 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 76319 | 76343 | sqlite3_mutex_leave(p->db->mutex); |
| 76320 | 76344 | } |
| 76321 | 76345 | return rc; |
| 76322 | 76346 | } |
| 76323 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ | |
| 76347 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ | |
| 76324 | 76348 | int rc; |
| 76325 | 76349 | Vdbe *p = (Vdbe *)pStmt; |
| 76326 | 76350 | sqlite3_mutex_enter(p->db->mutex); |
| 76327 | 76351 | if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 76328 | 76352 | rc = SQLITE_TOOBIG; |
| @@ -76337,11 +76361,11 @@ | ||
| 76337 | 76361 | |
| 76338 | 76362 | /* |
| 76339 | 76363 | ** Return the number of wildcards that can be potentially bound to. |
| 76340 | 76364 | ** This routine is added to support DBD::SQLite. |
| 76341 | 76365 | */ |
| 76342 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ | |
| 76366 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ | |
| 76343 | 76367 | Vdbe *p = (Vdbe*)pStmt; |
| 76344 | 76368 | return p ? p->nVar : 0; |
| 76345 | 76369 | } |
| 76346 | 76370 | |
| 76347 | 76371 | /* |
| @@ -76348,11 +76372,11 @@ | ||
| 76348 | 76372 | ** Return the name of a wildcard parameter. Return NULL if the index |
| 76349 | 76373 | ** is out of range or if the wildcard is unnamed. |
| 76350 | 76374 | ** |
| 76351 | 76375 | ** The result is always UTF-8. |
| 76352 | 76376 | */ |
| 76353 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ | |
| 76377 | +SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ | |
| 76354 | 76378 | Vdbe *p = (Vdbe*)pStmt; |
| 76355 | 76379 | if( p==0 || i<1 || i>p->nzVar ){ |
| 76356 | 76380 | return 0; |
| 76357 | 76381 | } |
| 76358 | 76382 | return p->azVar[i-1]; |
| @@ -76376,11 +76400,11 @@ | ||
| 76376 | 76400 | } |
| 76377 | 76401 | } |
| 76378 | 76402 | } |
| 76379 | 76403 | return 0; |
| 76380 | 76404 | } |
| 76381 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ | |
| 76405 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ | |
| 76382 | 76406 | return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName)); |
| 76383 | 76407 | } |
| 76384 | 76408 | |
| 76385 | 76409 | /* |
| 76386 | 76410 | ** Transfer all bindings from the first statement over to the second. |
| @@ -76410,11 +76434,11 @@ | ||
| 76410 | 76434 | ** |
| 76411 | 76435 | ** If the two statements contain a different number of bindings, then |
| 76412 | 76436 | ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise |
| 76413 | 76437 | ** SQLITE_OK is returned. |
| 76414 | 76438 | */ |
| 76415 | -SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ | |
| 76439 | +SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ | |
| 76416 | 76440 | Vdbe *pFrom = (Vdbe*)pFromStmt; |
| 76417 | 76441 | Vdbe *pTo = (Vdbe*)pToStmt; |
| 76418 | 76442 | if( pFrom->nVar!=pTo->nVar ){ |
| 76419 | 76443 | return SQLITE_ERROR; |
| 76420 | 76444 | } |
| @@ -76432,26 +76456,26 @@ | ||
| 76432 | 76456 | ** Return the sqlite3* database handle to which the prepared statement given |
| 76433 | 76457 | ** in the argument belongs. This is the same database handle that was |
| 76434 | 76458 | ** the first argument to the sqlite3_prepare() that was used to create |
| 76435 | 76459 | ** the statement in the first place. |
| 76436 | 76460 | */ |
| 76437 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){ | |
| 76461 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){ | |
| 76438 | 76462 | return pStmt ? ((Vdbe*)pStmt)->db : 0; |
| 76439 | 76463 | } |
| 76440 | 76464 | |
| 76441 | 76465 | /* |
| 76442 | 76466 | ** Return true if the prepared statement is guaranteed to not modify the |
| 76443 | 76467 | ** database. |
| 76444 | 76468 | */ |
| 76445 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){ | |
| 76469 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){ | |
| 76446 | 76470 | return pStmt ? ((Vdbe*)pStmt)->readOnly : 1; |
| 76447 | 76471 | } |
| 76448 | 76472 | |
| 76449 | 76473 | /* |
| 76450 | 76474 | ** Return true if the prepared statement is in need of being reset. |
| 76451 | 76475 | */ |
| 76452 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){ | |
| 76476 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){ | |
| 76453 | 76477 | Vdbe *v = (Vdbe*)pStmt; |
| 76454 | 76478 | return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN; |
| 76455 | 76479 | } |
| 76456 | 76480 | |
| 76457 | 76481 | /* |
| @@ -76458,11 +76482,11 @@ | ||
| 76458 | 76482 | ** Return a pointer to the next prepared statement after pStmt associated |
| 76459 | 76483 | ** with database connection pDb. If pStmt is NULL, return the first |
| 76460 | 76484 | ** prepared statement for the database connection. Return NULL if there |
| 76461 | 76485 | ** are no more. |
| 76462 | 76486 | */ |
| 76463 | -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){ | |
| 76487 | +SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){ | |
| 76464 | 76488 | sqlite3_stmt *pNext; |
| 76465 | 76489 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76466 | 76490 | if( !sqlite3SafetyCheckOk(pDb) ){ |
| 76467 | 76491 | (void)SQLITE_MISUSE_BKPT; |
| 76468 | 76492 | return 0; |
| @@ -76479,11 +76503,11 @@ | ||
| 76479 | 76503 | } |
| 76480 | 76504 | |
| 76481 | 76505 | /* |
| 76482 | 76506 | ** Return the value of a status counter for a prepared statement |
| 76483 | 76507 | */ |
| 76484 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ | |
| 76508 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ | |
| 76485 | 76509 | Vdbe *pVdbe = (Vdbe*)pStmt; |
| 76486 | 76510 | u32 v; |
| 76487 | 76511 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76488 | 76512 | if( !pStmt ){ |
| 76489 | 76513 | (void)SQLITE_MISUSE_BKPT; |
| @@ -76496,11 +76520,11 @@ | ||
| 76496 | 76520 | } |
| 76497 | 76521 | |
| 76498 | 76522 | /* |
| 76499 | 76523 | ** Return the SQL associated with a prepared statement |
| 76500 | 76524 | */ |
| 76501 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){ | |
| 76525 | +SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){ | |
| 76502 | 76526 | Vdbe *p = (Vdbe *)pStmt; |
| 76503 | 76527 | return p ? p->zSql : 0; |
| 76504 | 76528 | } |
| 76505 | 76529 | |
| 76506 | 76530 | /* |
| @@ -76510,11 +76534,11 @@ | ||
| 76510 | 76534 | ** freeing the returned string by passing it to sqlite3_free(). |
| 76511 | 76535 | ** |
| 76512 | 76536 | ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of |
| 76513 | 76537 | ** expanded bound parameters. |
| 76514 | 76538 | */ |
| 76515 | -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){ | |
| 76539 | +SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){ | |
| 76516 | 76540 | #ifdef SQLITE_OMIT_TRACE |
| 76517 | 76541 | return 0; |
| 76518 | 76542 | #else |
| 76519 | 76543 | char *z = 0; |
| 76520 | 76544 | const char *zSql = sqlite3_sql(pStmt); |
| @@ -76552,11 +76576,11 @@ | ||
| 76552 | 76576 | |
| 76553 | 76577 | /* |
| 76554 | 76578 | ** This function is called from within a pre-update callback to retrieve |
| 76555 | 76579 | ** a field of the row currently being updated or deleted. |
| 76556 | 76580 | */ |
| 76557 | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ | |
| 76581 | +SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ | |
| 76558 | 76582 | PreUpdate *p = db->pPreUpdate; |
| 76559 | 76583 | int rc = SQLITE_OK; |
| 76560 | 76584 | |
| 76561 | 76585 | /* Test that this call is being made from within an SQLITE_DELETE or |
| 76562 | 76586 | ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ |
| @@ -76607,11 +76631,11 @@ | ||
| 76607 | 76631 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76608 | 76632 | /* |
| 76609 | 76633 | ** This function is called from within a pre-update callback to retrieve |
| 76610 | 76634 | ** the number of columns in the row being updated, deleted or inserted. |
| 76611 | 76635 | */ |
| 76612 | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){ | |
| 76636 | +SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){ | |
| 76613 | 76637 | PreUpdate *p = db->pPreUpdate; |
| 76614 | 76638 | return (p ? p->keyinfo.nField : 0); |
| 76615 | 76639 | } |
| 76616 | 76640 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76617 | 76641 | |
| @@ -76625,11 +76649,11 @@ | ||
| 76625 | 76649 | ** top-level trigger etc.). |
| 76626 | 76650 | ** |
| 76627 | 76651 | ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL |
| 76628 | 76652 | ** or SET DEFAULT action is considered a trigger. |
| 76629 | 76653 | */ |
| 76630 | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){ | |
| 76654 | +SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){ | |
| 76631 | 76655 | PreUpdate *p = db->pPreUpdate; |
| 76632 | 76656 | return (p ? p->v->nFrame : 0); |
| 76633 | 76657 | } |
| 76634 | 76658 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76635 | 76659 | |
| @@ -76636,11 +76660,11 @@ | ||
| 76636 | 76660 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76637 | 76661 | /* |
| 76638 | 76662 | ** This function is called from within a pre-update callback to retrieve |
| 76639 | 76663 | ** a field of the row currently being updated or inserted. |
| 76640 | 76664 | */ |
| 76641 | -SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ | |
| 76665 | +SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ | |
| 76642 | 76666 | PreUpdate *p = db->pPreUpdate; |
| 76643 | 76667 | int rc = SQLITE_OK; |
| 76644 | 76668 | Mem *pMem; |
| 76645 | 76669 | |
| 76646 | 76670 | if( !p || p->op==SQLITE_DELETE ){ |
| @@ -76710,11 +76734,11 @@ | ||
| 76710 | 76734 | |
| 76711 | 76735 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 76712 | 76736 | /* |
| 76713 | 76737 | ** Return status data for a single loop within query pStmt. |
| 76714 | 76738 | */ |
| 76715 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( | |
| 76739 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus( | |
| 76716 | 76740 | sqlite3_stmt *pStmt, /* Prepared statement being queried */ |
| 76717 | 76741 | int idx, /* Index of loop to report on */ |
| 76718 | 76742 | int iScanStatusOp, /* Which metric to return */ |
| 76719 | 76743 | void *pOut /* OUT: Write the answer here */ |
| 76720 | 76744 | ){ |
| @@ -76769,11 +76793,11 @@ | ||
| 76769 | 76793 | } |
| 76770 | 76794 | |
| 76771 | 76795 | /* |
| 76772 | 76796 | ** Zero all counters associated with the sqlite3_stmt_scanstatus() data. |
| 76773 | 76797 | */ |
| 76774 | -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){ | |
| 76798 | +SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){ | |
| 76775 | 76799 | Vdbe *p = (Vdbe*)pStmt; |
| 76776 | 76800 | memset(p->anExec, 0, p->nOp * sizeof(i64)); |
| 76777 | 76801 | } |
| 76778 | 76802 | #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */ |
| 76779 | 76803 | |
| @@ -77296,11 +77320,11 @@ | ||
| 77296 | 77320 | ** Try to convert the type of a function argument or a result column |
| 77297 | 77321 | ** into a numeric representation. Use either INTEGER or REAL whichever |
| 77298 | 77322 | ** is appropriate. But only do the conversion if it is possible without |
| 77299 | 77323 | ** loss of information and return the revised type of the argument. |
| 77300 | 77324 | */ |
| 77301 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){ | |
| 77325 | +SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){ | |
| 77302 | 77326 | int eType = sqlite3_value_type(pVal); |
| 77303 | 77327 | if( eType==SQLITE_TEXT ){ |
| 77304 | 77328 | Mem *pMem = (Mem*)pVal; |
| 77305 | 77329 | applyNumericAffinity(pMem, 0); |
| 77306 | 77330 | eType = sqlite3_value_type(pVal); |
| @@ -84148,11 +84172,11 @@ | ||
| 84148 | 84172 | } |
| 84149 | 84173 | |
| 84150 | 84174 | /* |
| 84151 | 84175 | ** Open a blob handle. |
| 84152 | 84176 | */ |
| 84153 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( | |
| 84177 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_open( | |
| 84154 | 84178 | sqlite3* db, /* The database connection */ |
| 84155 | 84179 | const char *zDb, /* The attached database containing the blob */ |
| 84156 | 84180 | const char *zTable, /* The table containing the blob */ |
| 84157 | 84181 | const char *zColumn, /* The column containing the blob */ |
| 84158 | 84182 | sqlite_int64 iRow, /* The row containing the glob */ |
| @@ -84389,11 +84413,11 @@ | ||
| 84389 | 84413 | |
| 84390 | 84414 | /* |
| 84391 | 84415 | ** Close a blob handle that was previously created using |
| 84392 | 84416 | ** sqlite3_blob_open(). |
| 84393 | 84417 | */ |
| 84394 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){ | |
| 84418 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){ | |
| 84395 | 84419 | Incrblob *p = (Incrblob *)pBlob; |
| 84396 | 84420 | int rc; |
| 84397 | 84421 | sqlite3 *db; |
| 84398 | 84422 | |
| 84399 | 84423 | if( p ){ |
| @@ -84482,28 +84506,28 @@ | ||
| 84482 | 84506 | } |
| 84483 | 84507 | |
| 84484 | 84508 | /* |
| 84485 | 84509 | ** Read data from a blob handle. |
| 84486 | 84510 | */ |
| 84487 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ | |
| 84511 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ | |
| 84488 | 84512 | return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData); |
| 84489 | 84513 | } |
| 84490 | 84514 | |
| 84491 | 84515 | /* |
| 84492 | 84516 | ** Write data to a blob handle. |
| 84493 | 84517 | */ |
| 84494 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){ | |
| 84518 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){ | |
| 84495 | 84519 | return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData); |
| 84496 | 84520 | } |
| 84497 | 84521 | |
| 84498 | 84522 | /* |
| 84499 | 84523 | ** Query a blob handle for the size of the data. |
| 84500 | 84524 | ** |
| 84501 | 84525 | ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob |
| 84502 | 84526 | ** so no mutex is required for access. |
| 84503 | 84527 | */ |
| 84504 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){ | |
| 84528 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){ | |
| 84505 | 84529 | Incrblob *p = (Incrblob *)pBlob; |
| 84506 | 84530 | return (p && p->pStmt) ? p->nByte : 0; |
| 84507 | 84531 | } |
| 84508 | 84532 | |
| 84509 | 84533 | /* |
| @@ -84514,11 +84538,11 @@ | ||
| 84514 | 84538 | ** contain a blob or text value, then an error code is returned and the |
| 84515 | 84539 | ** database handle error code and message set. If this happens, then all |
| 84516 | 84540 | ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) |
| 84517 | 84541 | ** immediately return SQLITE_ABORT. |
| 84518 | 84542 | */ |
| 84519 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ | |
| 84543 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ | |
| 84520 | 84544 | int rc; |
| 84521 | 84545 | Incrblob *p = (Incrblob *)pBlob; |
| 84522 | 84546 | sqlite3 *db; |
| 84523 | 84547 | |
| 84524 | 84548 | if( p==0 ) return SQLITE_MISUSE_BKPT; |
| @@ -97118,11 +97142,11 @@ | ||
| 97118 | 97142 | ** and attempts to write the column will be ignored. |
| 97119 | 97143 | ** |
| 97120 | 97144 | ** Setting the auth function to NULL disables this hook. The default |
| 97121 | 97145 | ** setting of the auth function is NULL. |
| 97122 | 97146 | */ |
| 97123 | -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( | |
| 97147 | +SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer( | |
| 97124 | 97148 | sqlite3 *db, |
| 97125 | 97149 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 97126 | 97150 | void *pArg |
| 97127 | 97151 | ){ |
| 97128 | 97152 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -97162,10 +97186,11 @@ | ||
| 97162 | 97186 | ){ |
| 97163 | 97187 | sqlite3 *db = pParse->db; /* Database handle */ |
| 97164 | 97188 | char *zDb = db->aDb[iDb].zName; /* Name of attached database */ |
| 97165 | 97189 | int rc; /* Auth callback return code */ |
| 97166 | 97190 | |
| 97191 | + if( db->init.busy ) return SQLITE_OK; | |
| 97167 | 97192 | rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext |
| 97168 | 97193 | #ifdef SQLITE_USER_AUTHENTICATION |
| 97169 | 97194 | ,db->auth.zAuthUser |
| 97170 | 97195 | #endif |
| 97171 | 97196 | ); |
| @@ -103880,18 +103905,18 @@ | ||
| 103880 | 103905 | } |
| 103881 | 103906 | |
| 103882 | 103907 | /* |
| 103883 | 103908 | ** The sqlite3_strglob() interface. |
| 103884 | 103909 | */ |
| 103885 | -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){ | |
| 103910 | +SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){ | |
| 103886 | 103911 | return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0; |
| 103887 | 103912 | } |
| 103888 | 103913 | |
| 103889 | 103914 | /* |
| 103890 | 103915 | ** The sqlite3_strlike() interface. |
| 103891 | 103916 | */ |
| 103892 | -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){ | |
| 103917 | +SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){ | |
| 103893 | 103918 | return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0; |
| 103894 | 103919 | } |
| 103895 | 103920 | |
| 103896 | 103921 | /* |
| 103897 | 103922 | ** Count the number of times that the LIKE operator (or GLOB which is |
| @@ -108583,11 +108608,11 @@ | ||
| 108583 | 108608 | ** If the SQL is a query, then for each row in the query result |
| 108584 | 108609 | ** the xCallback() function is called. pArg becomes the first |
| 108585 | 108610 | ** argument to xCallback(). If xCallback=NULL then no callback |
| 108586 | 108611 | ** is invoked, even for queries. |
| 108587 | 108612 | */ |
| 108588 | -SQLITE_API int SQLITE_STDCALL sqlite3_exec( | |
| 108613 | +SQLITE_API int SQLITE_APICALL sqlite3_exec( | |
| 108589 | 108614 | sqlite3 *db, /* The database on which the SQL executes */ |
| 108590 | 108615 | const char *zSql, /* The SQL to be executed */ |
| 108591 | 108616 | sqlite3_callback xCallback, /* Invoke this callback routine */ |
| 108592 | 108617 | void *pArg, /* First argument to xCallback() */ |
| 108593 | 108618 | char **pzErrMsg /* Write error messages here */ |
| @@ -108974,16 +108999,17 @@ | ||
| 108974 | 108999 | sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64); |
| 108975 | 109000 | const char *(*uri_parameter)(const char*,const char*); |
| 108976 | 109001 | char *(*vsnprintf)(int,char*,const char*,va_list); |
| 108977 | 109002 | int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*); |
| 108978 | 109003 | /* Version 3.8.7 and later */ |
| 108979 | - int (*auto_extension)(void(*)(void)); | |
| 109004 | + int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*)); | |
| 108980 | 109005 | int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64, |
| 108981 | 109006 | void(*)(void*)); |
| 108982 | 109007 | int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64, |
| 108983 | 109008 | void(*)(void*),unsigned char); |
| 108984 | - int (*cancel_auto_extension)(void(*)(void)); | |
| 109009 | + int (*cancel_auto_extension)(int(*)(sqlite3*,char**, | |
| 109010 | + const sqlite3_api_routines*)); | |
| 108985 | 109011 | int (*load_extension)(sqlite3*,const char*,const char*,char**); |
| 108986 | 109012 | void *(*malloc64)(sqlite3_uint64); |
| 108987 | 109013 | sqlite3_uint64 (*msize)(void*); |
| 108988 | 109014 | void *(*realloc64)(void*,sqlite3_uint64); |
| 108989 | 109015 | void (*reset_auto_extension)(void); |
| @@ -109008,10 +109034,20 @@ | ||
| 109008 | 109034 | int (*system_errno)(sqlite3*); |
| 109009 | 109035 | /* Version 3.14.0 and later */ |
| 109010 | 109036 | int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*); |
| 109011 | 109037 | char *(*expanded_sql)(sqlite3_stmt*); |
| 109012 | 109038 | }; |
| 109039 | + | |
| 109040 | +/* | |
| 109041 | +** This is the function signature used for all extension entry points. It | |
| 109042 | +** is also defined in the file "loadext.c". | |
| 109043 | +*/ | |
| 109044 | +typedef int (*sqlite3_loadext_entry)( | |
| 109045 | + sqlite3 *db, /* Handle to the database. */ | |
| 109046 | + char **pzErrMsg, /* Used to set error string on failure. */ | |
| 109047 | + const sqlite3_api_routines *pThunk /* Extension API function pointers. */ | |
| 109048 | +); | |
| 109013 | 109049 | |
| 109014 | 109050 | /* |
| 109015 | 109051 | ** The following macros redefine the API routines so that they are |
| 109016 | 109052 | ** redirected through the global sqlite3_api structure. |
| 109017 | 109053 | ** |
| @@ -109280,10 +109316,18 @@ | ||
| 109280 | 109316 | /************** Continuing where we left off in loadext.c ********************/ |
| 109281 | 109317 | /* #include "sqliteInt.h" */ |
| 109282 | 109318 | /* #include <string.h> */ |
| 109283 | 109319 | |
| 109284 | 109320 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 109321 | +/* | |
| 109322 | +** This is the function signature used for all extension entry points. | |
| 109323 | +*/ | |
| 109324 | +typedef int (*sqlite3_loadext_entry)( | |
| 109325 | + sqlite3 *db, /* Handle to the database. */ | |
| 109326 | + char **pzErrMsg, /* Used to set error string on failure. */ | |
| 109327 | + const sqlite3_api_routines *pThunk /* Extension API function pointers. */ | |
| 109328 | +); | |
| 109285 | 109329 | |
| 109286 | 109330 | /* |
| 109287 | 109331 | ** Some API routines are omitted when various features are |
| 109288 | 109332 | ** excluded from a build of SQLite. Substitute a NULL pointer |
| 109289 | 109333 | ** for any missing APIs. |
| @@ -109369,10 +109413,14 @@ | ||
| 109369 | 109413 | #define sqlite3_blob_open 0 |
| 109370 | 109414 | #define sqlite3_blob_read 0 |
| 109371 | 109415 | #define sqlite3_blob_write 0 |
| 109372 | 109416 | #define sqlite3_blob_reopen 0 |
| 109373 | 109417 | #endif |
| 109418 | + | |
| 109419 | +#if defined(SQLITE_OMIT_TRACE) | |
| 109420 | +# define sqlite3_trace_v2 0 | |
| 109421 | +#endif | |
| 109374 | 109422 | |
| 109375 | 109423 | /* |
| 109376 | 109424 | ** The following structure contains pointers to all SQLite API routines. |
| 109377 | 109425 | ** A pointer to this structure is passed into extensions when they are |
| 109378 | 109426 | ** loaded so that the extension can make calls back into the SQLite |
| @@ -109675,11 +109723,14 @@ | ||
| 109675 | 109723 | /* Version 3.10.0 and later */ |
| 109676 | 109724 | sqlite3_status64, |
| 109677 | 109725 | sqlite3_strlike, |
| 109678 | 109726 | sqlite3_db_cacheflush, |
| 109679 | 109727 | /* Version 3.12.0 and later */ |
| 109680 | - sqlite3_system_errno | |
| 109728 | + sqlite3_system_errno, | |
| 109729 | + /* Version 3.14.0 and later */ | |
| 109730 | + sqlite3_trace_v2, | |
| 109731 | + sqlite3_expanded_sql | |
| 109681 | 109732 | }; |
| 109682 | 109733 | |
| 109683 | 109734 | /* |
| 109684 | 109735 | ** Attempt to load an SQLite extension library contained in the file |
| 109685 | 109736 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| @@ -109698,11 +109749,11 @@ | ||
| 109698 | 109749 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 109699 | 109750 | char **pzErrMsg /* Put error message here if not 0 */ |
| 109700 | 109751 | ){ |
| 109701 | 109752 | sqlite3_vfs *pVfs = db->pVfs; |
| 109702 | 109753 | void *handle; |
| 109703 | - int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*); | |
| 109754 | + sqlite3_loadext_entry xInit; | |
| 109704 | 109755 | char *zErrmsg = 0; |
| 109705 | 109756 | const char *zEntry; |
| 109706 | 109757 | char *zAltEntry = 0; |
| 109707 | 109758 | void **aHandle; |
| 109708 | 109759 | u64 nMsg = 300 + sqlite3Strlen30(zFile); |
| @@ -109757,12 +109808,11 @@ | ||
| 109757 | 109808 | sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); |
| 109758 | 109809 | } |
| 109759 | 109810 | } |
| 109760 | 109811 | return SQLITE_ERROR; |
| 109761 | 109812 | } |
| 109762 | - xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*)) | |
| 109763 | - sqlite3OsDlSym(pVfs, handle, zEntry); | |
| 109813 | + xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry); | |
| 109764 | 109814 | |
| 109765 | 109815 | /* If no entry point was specified and the default legacy |
| 109766 | 109816 | ** entry point name "sqlite3_extension_init" was not found, then |
| 109767 | 109817 | ** construct an entry point name "sqlite3_X_init" where the X is |
| 109768 | 109818 | ** replaced by the lowercase value of every ASCII alphabetic |
| @@ -109790,12 +109840,11 @@ | ||
| 109790 | 109840 | zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c]; |
| 109791 | 109841 | } |
| 109792 | 109842 | } |
| 109793 | 109843 | memcpy(zAltEntry+iEntry, "_init", 6); |
| 109794 | 109844 | zEntry = zAltEntry; |
| 109795 | - xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*)) | |
| 109796 | - sqlite3OsDlSym(pVfs, handle, zEntry); | |
| 109845 | + xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry); | |
| 109797 | 109846 | } |
| 109798 | 109847 | if( xInit==0 ){ |
| 109799 | 109848 | if( pzErrMsg ){ |
| 109800 | 109849 | nMsg += sqlite3Strlen30(zEntry); |
| 109801 | 109850 | *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); |
| @@ -109833,11 +109882,11 @@ | ||
| 109833 | 109882 | db->aExtension = aHandle; |
| 109834 | 109883 | |
| 109835 | 109884 | db->aExtension[db->nExtension++] = handle; |
| 109836 | 109885 | return SQLITE_OK; |
| 109837 | 109886 | } |
| 109838 | -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( | |
| 109887 | +SQLITE_API int SQLITE_APICALL sqlite3_load_extension( | |
| 109839 | 109888 | sqlite3 *db, /* Load the extension into this database connection */ |
| 109840 | 109889 | const char *zFile, /* Name of the shared library containing extension */ |
| 109841 | 109890 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 109842 | 109891 | char **pzErrMsg /* Put error message here if not 0 */ |
| 109843 | 109892 | ){ |
| @@ -109864,11 +109913,11 @@ | ||
| 109864 | 109913 | |
| 109865 | 109914 | /* |
| 109866 | 109915 | ** Enable or disable extension loading. Extension loading is disabled by |
| 109867 | 109916 | ** default so as not to open security holes in older applications. |
| 109868 | 109917 | */ |
| 109869 | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){ | |
| 109918 | +SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){ | |
| 109870 | 109919 | sqlite3_mutex_enter(db->mutex); |
| 109871 | 109920 | if( onoff ){ |
| 109872 | 109921 | db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc; |
| 109873 | 109922 | }else{ |
| 109874 | 109923 | db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc); |
| @@ -109921,11 +109970,13 @@ | ||
| 109921 | 109970 | |
| 109922 | 109971 | /* |
| 109923 | 109972 | ** Register a statically linked extension that is automatically |
| 109924 | 109973 | ** loaded by every new database connection. |
| 109925 | 109974 | */ |
| 109926 | -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){ | |
| 109975 | +SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( | |
| 109976 | + int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) | |
| 109977 | +){ | |
| 109927 | 109978 | int rc = SQLITE_OK; |
| 109928 | 109979 | #ifndef SQLITE_OMIT_AUTOINIT |
| 109929 | 109980 | rc = sqlite3_initialize(); |
| 109930 | 109981 | if( rc ){ |
| 109931 | 109982 | return rc; |
| @@ -109937,21 +109988,21 @@ | ||
| 109937 | 109988 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 109938 | 109989 | #endif |
| 109939 | 109990 | wsdAutoextInit; |
| 109940 | 109991 | sqlite3_mutex_enter(mutex); |
| 109941 | 109992 | for(i=0; i<wsdAutoext.nExt; i++){ |
| 109942 | - if( wsdAutoext.aExt[i]==xInit ) break; | |
| 109993 | + if( wsdAutoext.aExt[i]==(void*)xInit ) break; | |
| 109943 | 109994 | } |
| 109944 | 109995 | if( i==wsdAutoext.nExt ){ |
| 109945 | 109996 | u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]); |
| 109946 | 109997 | void (**aNew)(void); |
| 109947 | 109998 | aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte); |
| 109948 | 109999 | if( aNew==0 ){ |
| 109949 | 110000 | rc = SQLITE_NOMEM_BKPT; |
| 109950 | 110001 | }else{ |
| 109951 | 110002 | wsdAutoext.aExt = aNew; |
| 109952 | - wsdAutoext.aExt[wsdAutoext.nExt] = xInit; | |
| 110003 | + wsdAutoext.aExt[wsdAutoext.nExt] = (void*)xInit; | |
| 109953 | 110004 | wsdAutoext.nExt++; |
| 109954 | 110005 | } |
| 109955 | 110006 | } |
| 109956 | 110007 | sqlite3_mutex_leave(mutex); |
| 109957 | 110008 | assert( (rc&0xff)==rc ); |
| @@ -109966,20 +110017,22 @@ | ||
| 109966 | 110017 | ** routine is a no-op. |
| 109967 | 110018 | ** |
| 109968 | 110019 | ** Return 1 if xInit was found on the list and removed. Return 0 if xInit |
| 109969 | 110020 | ** was not on the list. |
| 109970 | 110021 | */ |
| 109971 | -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){ | |
| 110022 | +SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( | |
| 110023 | + int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) | |
| 110024 | +){ | |
| 109972 | 110025 | #if SQLITE_THREADSAFE |
| 109973 | 110026 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 109974 | 110027 | #endif |
| 109975 | 110028 | int i; |
| 109976 | 110029 | int n = 0; |
| 109977 | 110030 | wsdAutoextInit; |
| 109978 | 110031 | sqlite3_mutex_enter(mutex); |
| 109979 | 110032 | for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
| 109980 | - if( wsdAutoext.aExt[i]==xInit ){ | |
| 110033 | + if( wsdAutoext.aExt[i]==(void*)xInit ){ | |
| 109981 | 110034 | wsdAutoext.nExt--; |
| 109982 | 110035 | wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt]; |
| 109983 | 110036 | n++; |
| 109984 | 110037 | break; |
| 109985 | 110038 | } |
| @@ -109989,11 +110042,11 @@ | ||
| 109989 | 110042 | } |
| 109990 | 110043 | |
| 109991 | 110044 | /* |
| 109992 | 110045 | ** Reset the automatic extension loading mechanism. |
| 109993 | 110046 | */ |
| 109994 | -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){ | |
| 110047 | +SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){ | |
| 109995 | 110048 | #ifndef SQLITE_OMIT_AUTOINIT |
| 109996 | 110049 | if( sqlite3_initialize()==SQLITE_OK ) |
| 109997 | 110050 | #endif |
| 109998 | 110051 | { |
| 109999 | 110052 | #if SQLITE_THREADSAFE |
| @@ -110015,11 +110068,11 @@ | ||
| 110015 | 110068 | */ |
| 110016 | 110069 | SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ |
| 110017 | 110070 | u32 i; |
| 110018 | 110071 | int go = 1; |
| 110019 | 110072 | int rc; |
| 110020 | - int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*); | |
| 110073 | + sqlite3_loadext_entry xInit; | |
| 110021 | 110074 | |
| 110022 | 110075 | wsdAutoextInit; |
| 110023 | 110076 | if( wsdAutoext.nExt==0 ){ |
| 110024 | 110077 | /* Common case: early out without every having to acquire a mutex */ |
| 110025 | 110078 | return; |
| @@ -110032,12 +110085,11 @@ | ||
| 110032 | 110085 | sqlite3_mutex_enter(mutex); |
| 110033 | 110086 | if( i>=wsdAutoext.nExt ){ |
| 110034 | 110087 | xInit = 0; |
| 110035 | 110088 | go = 0; |
| 110036 | 110089 | }else{ |
| 110037 | - xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*)) | |
| 110038 | - wsdAutoext.aExt[i]; | |
| 110090 | + xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i]; | |
| 110039 | 110091 | } |
| 110040 | 110092 | sqlite3_mutex_leave(mutex); |
| 110041 | 110093 | zErrmsg = 0; |
| 110042 | 110094 | if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){ |
| 110043 | 110095 | sqlite3ErrorWithMsg(db, rc, |
| @@ -113251,11 +113303,11 @@ | ||
| 113251 | 113303 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 113252 | 113304 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 113253 | 113305 | ** and the statement is automatically recompiled if an schema change |
| 113254 | 113306 | ** occurs. |
| 113255 | 113307 | */ |
| 113256 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare( | |
| 113308 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare( | |
| 113257 | 113309 | sqlite3 *db, /* Database handle. */ |
| 113258 | 113310 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 113259 | 113311 | int nBytes, /* Length of zSql in bytes. */ |
| 113260 | 113312 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113261 | 113313 | const char **pzTail /* OUT: End of parsed string */ |
| @@ -113263,11 +113315,11 @@ | ||
| 113263 | 113315 | int rc; |
| 113264 | 113316 | rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail); |
| 113265 | 113317 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 113266 | 113318 | return rc; |
| 113267 | 113319 | } |
| 113268 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( | |
| 113320 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2( | |
| 113269 | 113321 | sqlite3 *db, /* Database handle. */ |
| 113270 | 113322 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 113271 | 113323 | int nBytes, /* Length of zSql in bytes. */ |
| 113272 | 113324 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113273 | 113325 | const char **pzTail /* OUT: End of parsed string */ |
| @@ -113339,11 +113391,11 @@ | ||
| 113339 | 113391 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 113340 | 113392 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 113341 | 113393 | ** and the statement is automatically recompiled if an schema change |
| 113342 | 113394 | ** occurs. |
| 113343 | 113395 | */ |
| 113344 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( | |
| 113396 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare16( | |
| 113345 | 113397 | sqlite3 *db, /* Database handle. */ |
| 113346 | 113398 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 113347 | 113399 | int nBytes, /* Length of zSql in bytes. */ |
| 113348 | 113400 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113349 | 113401 | const void **pzTail /* OUT: End of parsed string */ |
| @@ -113351,11 +113403,11 @@ | ||
| 113351 | 113403 | int rc; |
| 113352 | 113404 | rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail); |
| 113353 | 113405 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 113354 | 113406 | return rc; |
| 113355 | 113407 | } |
| 113356 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( | |
| 113408 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2( | |
| 113357 | 113409 | sqlite3 *db, /* Database handle. */ |
| 113358 | 113410 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 113359 | 113411 | int nBytes, /* Length of zSql in bytes. */ |
| 113360 | 113412 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113361 | 113413 | const void **pzTail /* OUT: End of parsed string */ |
| @@ -119194,11 +119246,11 @@ | ||
| 119194 | 119246 | ** The result that is written to ***pazResult is held in memory obtained |
| 119195 | 119247 | ** from malloc(). But the caller cannot free this memory directly. |
| 119196 | 119248 | ** Instead, the entire table should be passed to sqlite3_free_table() when |
| 119197 | 119249 | ** the calling procedure is finished using it. |
| 119198 | 119250 | */ |
| 119199 | -SQLITE_API int SQLITE_STDCALL sqlite3_get_table( | |
| 119251 | +SQLITE_API int SQLITE_APICALL sqlite3_get_table( | |
| 119200 | 119252 | sqlite3 *db, /* The database on which the SQL executes */ |
| 119201 | 119253 | const char *zSql, /* The SQL to be executed */ |
| 119202 | 119254 | char ***pazResult, /* Write the result table here */ |
| 119203 | 119255 | int *pnRow, /* Write the number of rows in the result here */ |
| 119204 | 119256 | int *pnColumn, /* Write the number of columns of result here */ |
| @@ -119263,11 +119315,11 @@ | ||
| 119263 | 119315 | } |
| 119264 | 119316 | |
| 119265 | 119317 | /* |
| 119266 | 119318 | ** This routine frees the space the sqlite3_get_table() malloced. |
| 119267 | 119319 | */ |
| 119268 | -SQLITE_API void SQLITE_STDCALL sqlite3_free_table( | |
| 119320 | +SQLITE_API void SQLITE_APICALL sqlite3_free_table( | |
| 119269 | 119321 | char **azResult /* Result returned from sqlite3_get_table() */ |
| 119270 | 119322 | ){ |
| 119271 | 119323 | if( azResult ){ |
| 119272 | 119324 | int i, n; |
| 119273 | 119325 | azResult--; |
| @@ -121673,11 +121725,11 @@ | ||
| 121673 | 121725 | |
| 121674 | 121726 | |
| 121675 | 121727 | /* |
| 121676 | 121728 | ** External API function used to create a new virtual-table module. |
| 121677 | 121729 | */ |
| 121678 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module( | |
| 121730 | +SQLITE_API int SQLITE_APICALL sqlite3_create_module( | |
| 121679 | 121731 | sqlite3 *db, /* Database in which module is registered */ |
| 121680 | 121732 | const char *zName, /* Name assigned to this module */ |
| 121681 | 121733 | const sqlite3_module *pModule, /* The definition of the module */ |
| 121682 | 121734 | void *pAux /* Context pointer for xCreate/xConnect */ |
| 121683 | 121735 | ){ |
| @@ -121688,11 +121740,11 @@ | ||
| 121688 | 121740 | } |
| 121689 | 121741 | |
| 121690 | 121742 | /* |
| 121691 | 121743 | ** External API function used to create a new virtual-table module. |
| 121692 | 121744 | */ |
| 121693 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( | |
| 121745 | +SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2( | |
| 121694 | 121746 | sqlite3 *db, /* Database in which module is registered */ |
| 121695 | 121747 | const char *zName, /* Name assigned to this module */ |
| 121696 | 121748 | const sqlite3_module *pModule, /* The definition of the module */ |
| 121697 | 121749 | void *pAux, /* Context pointer for xCreate/xConnect */ |
| 121698 | 121750 | void (*xDestroy)(void *) /* Module destructor function */ |
| @@ -122312,11 +122364,11 @@ | ||
| 122312 | 122364 | /* |
| 122313 | 122365 | ** This function is used to set the schema of a virtual table. It is only |
| 122314 | 122366 | ** valid to call this function from within the xCreate() or xConnect() of a |
| 122315 | 122367 | ** virtual table module. |
| 122316 | 122368 | */ |
| 122317 | -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ | |
| 122369 | +SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ | |
| 122318 | 122370 | VtabCtx *pCtx; |
| 122319 | 122371 | Parse *pParse; |
| 122320 | 122372 | int rc = SQLITE_OK; |
| 122321 | 122373 | Table *pTab; |
| 122322 | 122374 | char *zErr = 0; |
| @@ -122766,11 +122818,11 @@ | ||
| 122766 | 122818 | ** table update operation currently in progress. |
| 122767 | 122819 | ** |
| 122768 | 122820 | ** The results of this routine are undefined unless it is called from |
| 122769 | 122821 | ** within an xUpdate method. |
| 122770 | 122822 | */ |
| 122771 | -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){ | |
| 122823 | +SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){ | |
| 122772 | 122824 | static const unsigned char aMap[] = { |
| 122773 | 122825 | SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE |
| 122774 | 122826 | }; |
| 122775 | 122827 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 122776 | 122828 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| @@ -129063,15 +129115,15 @@ | ||
| 129063 | 129115 | LogEst nIter; |
| 129064 | 129116 | pNew->u.btree.nEq++; |
| 129065 | 129117 | pNew->nSkip++; |
| 129066 | 129118 | pNew->aLTerm[pNew->nLTerm++] = 0; |
| 129067 | 129119 | pNew->wsFlags |= WHERE_SKIPSCAN; |
| 129068 | - nIter = pProbe->aiRowLogEst[saved_nEq]+1 - pProbe->aiRowLogEst[saved_nEq+1]; | |
| 129120 | + nIter = pProbe->aiRowLogEst[saved_nEq] - pProbe->aiRowLogEst[saved_nEq+1]; | |
| 129069 | 129121 | pNew->nOut -= nIter; |
| 129070 | 129122 | /* TUNING: Because uncertainties in the estimates for skip-scan queries, |
| 129071 | 129123 | ** add a 1.375 fudge factor to make skip-scan slightly less likely. */ |
| 129072 | - nIter += 4; | |
| 129124 | + nIter += 5; | |
| 129073 | 129125 | whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul); |
| 129074 | 129126 | pNew->nOut = saved_nOut; |
| 129075 | 129127 | pNew->u.btree.nEq = saved_nEq; |
| 129076 | 129128 | pNew->nSkip = saved_nSkip; |
| 129077 | 129129 | pNew->wsFlags = saved_wsFlags; |
| @@ -136091,11 +136143,11 @@ | ||
| 136091 | 136143 | ** |
| 136092 | 136144 | ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed |
| 136093 | 136145 | ** to recognize the end of a trigger can be omitted. All we have to do |
| 136094 | 136146 | ** is look for a semicolon that is not part of an string or comment. |
| 136095 | 136147 | */ |
| 136096 | -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){ | |
| 136148 | +SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){ | |
| 136097 | 136149 | u8 state = 0; /* Current state, using numbers defined in header comment */ |
| 136098 | 136150 | u8 token; /* Value of the next token */ |
| 136099 | 136151 | |
| 136100 | 136152 | #ifndef SQLITE_OMIT_TRIGGER |
| 136101 | 136153 | /* A complex statement machine used to detect the end of a CREATE TRIGGER |
| @@ -136256,11 +136308,11 @@ | ||
| 136256 | 136308 | /* |
| 136257 | 136309 | ** This routine is the same as the sqlite3_complete() routine described |
| 136258 | 136310 | ** above, except that the parameter is required to be UTF-16 encoded, not |
| 136259 | 136311 | ** UTF-8. |
| 136260 | 136312 | */ |
| 136261 | -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){ | |
| 136313 | +SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){ | |
| 136262 | 136314 | sqlite3_value *pVal; |
| 136263 | 136315 | char const *zSql8; |
| 136264 | 136316 | int rc; |
| 136265 | 136317 | |
| 136266 | 136318 | #ifndef SQLITE_OMIT_AUTOINIT |
| @@ -136416,28 +136468,28 @@ | ||
| 136416 | 136468 | #endif |
| 136417 | 136469 | |
| 136418 | 136470 | /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns |
| 136419 | 136471 | ** a pointer to the to the sqlite3_version[] string constant. |
| 136420 | 136472 | */ |
| 136421 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; } | |
| 136473 | +SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; } | |
| 136422 | 136474 | |
| 136423 | 136475 | /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a |
| 136424 | 136476 | ** pointer to a string constant whose value is the same as the |
| 136425 | 136477 | ** SQLITE_SOURCE_ID C preprocessor macro. |
| 136426 | 136478 | */ |
| 136427 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } | |
| 136479 | +SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } | |
| 136428 | 136480 | |
| 136429 | 136481 | /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function |
| 136430 | 136482 | ** returns an integer equal to SQLITE_VERSION_NUMBER. |
| 136431 | 136483 | */ |
| 136432 | -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } | |
| 136484 | +SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } | |
| 136433 | 136485 | |
| 136434 | 136486 | /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns |
| 136435 | 136487 | ** zero if and only if SQLite was compiled with mutexing code omitted due to |
| 136436 | 136488 | ** the SQLITE_THREADSAFE compile-time option being set to 0. |
| 136437 | 136489 | */ |
| 136438 | -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } | |
| 136490 | +SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } | |
| 136439 | 136491 | |
| 136440 | 136492 | /* |
| 136441 | 136493 | ** When compiling the test fixture or with debugging enabled (on Win32), |
| 136442 | 136494 | ** this variable being set to non-zero will cause OSTRACE macros to emit |
| 136443 | 136495 | ** extra diagnostic information. |
| @@ -136506,11 +136558,11 @@ | ||
| 136506 | 136558 | ** call by X completes. |
| 136507 | 136559 | ** |
| 136508 | 136560 | ** * Recursive calls to this routine from thread X return immediately |
| 136509 | 136561 | ** without blocking. |
| 136510 | 136562 | */ |
| 136511 | -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){ | |
| 136563 | +SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){ | |
| 136512 | 136564 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 136513 | 136565 | int rc; /* Result code */ |
| 136514 | 136566 | #ifdef SQLITE_EXTRA_INIT |
| 136515 | 136567 | int bRunExtraInit = 0; /* Extra initialization needed */ |
| 136516 | 136568 | #endif |
| @@ -136672,11 +136724,11 @@ | ||
| 136672 | 136724 | ** while any part of SQLite is otherwise in use in any thread. This |
| 136673 | 136725 | ** routine is not threadsafe. But it is safe to invoke this routine |
| 136674 | 136726 | ** on when SQLite is already shut down. If SQLite is already shut down |
| 136675 | 136727 | ** when this routine is invoked, then this routine is a harmless no-op. |
| 136676 | 136728 | */ |
| 136677 | -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){ | |
| 136729 | +SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){ | |
| 136678 | 136730 | #ifdef SQLITE_OMIT_WSD |
| 136679 | 136731 | int rc = sqlite3_wsd_init(4096, 24); |
| 136680 | 136732 | if( rc!=SQLITE_OK ){ |
| 136681 | 136733 | return rc; |
| 136682 | 136734 | } |
| @@ -137091,11 +137143,11 @@ | ||
| 137091 | 137143 | } |
| 137092 | 137144 | |
| 137093 | 137145 | /* |
| 137094 | 137146 | ** Return the mutex associated with a database connection. |
| 137095 | 137147 | */ |
| 137096 | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){ | |
| 137148 | +SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){ | |
| 137097 | 137149 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137098 | 137150 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137099 | 137151 | (void)SQLITE_MISUSE_BKPT; |
| 137100 | 137152 | return 0; |
| 137101 | 137153 | } |
| @@ -137105,11 +137157,11 @@ | ||
| 137105 | 137157 | |
| 137106 | 137158 | /* |
| 137107 | 137159 | ** Free up as much memory as we can from the given database |
| 137108 | 137160 | ** connection. |
| 137109 | 137161 | */ |
| 137110 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){ | |
| 137162 | +SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){ | |
| 137111 | 137163 | int i; |
| 137112 | 137164 | |
| 137113 | 137165 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137114 | 137166 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 137115 | 137167 | #endif |
| @@ -137129,11 +137181,11 @@ | ||
| 137129 | 137181 | |
| 137130 | 137182 | /* |
| 137131 | 137183 | ** Flush any dirty pages in the pager-cache for any attached database |
| 137132 | 137184 | ** to disk. |
| 137133 | 137185 | */ |
| 137134 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){ | |
| 137186 | +SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){ | |
| 137135 | 137187 | int i; |
| 137136 | 137188 | int rc = SQLITE_OK; |
| 137137 | 137189 | int bSeenBusy = 0; |
| 137138 | 137190 | |
| 137139 | 137191 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -137279,11 +137331,11 @@ | ||
| 137279 | 137331 | } |
| 137280 | 137332 | |
| 137281 | 137333 | /* |
| 137282 | 137334 | ** Return the ROWID of the most recent insert |
| 137283 | 137335 | */ |
| 137284 | -SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){ | |
| 137336 | +SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){ | |
| 137285 | 137337 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137286 | 137338 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137287 | 137339 | (void)SQLITE_MISUSE_BKPT; |
| 137288 | 137340 | return 0; |
| 137289 | 137341 | } |
| @@ -137292,11 +137344,11 @@ | ||
| 137292 | 137344 | } |
| 137293 | 137345 | |
| 137294 | 137346 | /* |
| 137295 | 137347 | ** Return the number of changes in the most recent call to sqlite3_exec(). |
| 137296 | 137348 | */ |
| 137297 | -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){ | |
| 137349 | +SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){ | |
| 137298 | 137350 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137299 | 137351 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137300 | 137352 | (void)SQLITE_MISUSE_BKPT; |
| 137301 | 137353 | return 0; |
| 137302 | 137354 | } |
| @@ -137305,11 +137357,11 @@ | ||
| 137305 | 137357 | } |
| 137306 | 137358 | |
| 137307 | 137359 | /* |
| 137308 | 137360 | ** Return the number of changes since the database handle was opened. |
| 137309 | 137361 | */ |
| 137310 | -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){ | |
| 137362 | +SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){ | |
| 137311 | 137363 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137312 | 137364 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137313 | 137365 | (void)SQLITE_MISUSE_BKPT; |
| 137314 | 137366 | return 0; |
| 137315 | 137367 | } |
| @@ -137456,12 +137508,12 @@ | ||
| 137456 | 137508 | ** statements or unfinished sqlite3_backups. The sqlite3_close_v2() |
| 137457 | 137509 | ** version forces the connection to become a zombie if there are |
| 137458 | 137510 | ** unclosed resources, and arranges for deallocation when the last |
| 137459 | 137511 | ** prepare statement or sqlite3_backup closes. |
| 137460 | 137512 | */ |
| 137461 | -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); } | |
| 137462 | -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); } | |
| 137513 | +SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); } | |
| 137514 | +SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); } | |
| 137463 | 137515 | |
| 137464 | 137516 | |
| 137465 | 137517 | /* |
| 137466 | 137518 | ** Close the mutex on database connection db. |
| 137467 | 137519 | ** |
| @@ -137864,11 +137916,11 @@ | ||
| 137864 | 137916 | |
| 137865 | 137917 | /* |
| 137866 | 137918 | ** This routine sets the busy callback for an Sqlite database to the |
| 137867 | 137919 | ** given callback function with the given argument. |
| 137868 | 137920 | */ |
| 137869 | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler( | |
| 137921 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_handler( | |
| 137870 | 137922 | sqlite3 *db, |
| 137871 | 137923 | int (*xBusy)(void*,int), |
| 137872 | 137924 | void *pArg |
| 137873 | 137925 | ){ |
| 137874 | 137926 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -137887,11 +137939,11 @@ | ||
| 137887 | 137939 | /* |
| 137888 | 137940 | ** This routine sets the progress callback for an Sqlite database to the |
| 137889 | 137941 | ** given callback function with the given argument. The progress callback will |
| 137890 | 137942 | ** be invoked every nOps opcodes. |
| 137891 | 137943 | */ |
| 137892 | -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler( | |
| 137944 | +SQLITE_API void SQLITE_APICALL sqlite3_progress_handler( | |
| 137893 | 137945 | sqlite3 *db, |
| 137894 | 137946 | int nOps, |
| 137895 | 137947 | int (*xProgress)(void*), |
| 137896 | 137948 | void *pArg |
| 137897 | 137949 | ){ |
| @@ -137918,11 +137970,11 @@ | ||
| 137918 | 137970 | |
| 137919 | 137971 | /* |
| 137920 | 137972 | ** This routine installs a default busy handler that waits for the |
| 137921 | 137973 | ** specified number of milliseconds before returning 0. |
| 137922 | 137974 | */ |
| 137923 | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){ | |
| 137975 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){ | |
| 137924 | 137976 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137925 | 137977 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 137926 | 137978 | #endif |
| 137927 | 137979 | if( ms>0 ){ |
| 137928 | 137980 | sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); |
| @@ -137934,11 +137986,11 @@ | ||
| 137934 | 137986 | } |
| 137935 | 137987 | |
| 137936 | 137988 | /* |
| 137937 | 137989 | ** Cause any pending operation to stop at its earliest opportunity. |
| 137938 | 137990 | */ |
| 137939 | -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){ | |
| 137991 | +SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){ | |
| 137940 | 137992 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137941 | 137993 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137942 | 137994 | (void)SQLITE_MISUSE_BKPT; |
| 137943 | 137995 | return; |
| 137944 | 137996 | } |
| @@ -138050,11 +138102,11 @@ | ||
| 138050 | 138102 | } |
| 138051 | 138103 | |
| 138052 | 138104 | /* |
| 138053 | 138105 | ** Create new user functions. |
| 138054 | 138106 | */ |
| 138055 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function( | |
| 138107 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function( | |
| 138056 | 138108 | sqlite3 *db, |
| 138057 | 138109 | const char *zFunc, |
| 138058 | 138110 | int nArg, |
| 138059 | 138111 | int enc, |
| 138060 | 138112 | void *p, |
| @@ -138064,11 +138116,11 @@ | ||
| 138064 | 138116 | ){ |
| 138065 | 138117 | return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep, |
| 138066 | 138118 | xFinal, 0); |
| 138067 | 138119 | } |
| 138068 | 138120 | |
| 138069 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( | |
| 138121 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2( | |
| 138070 | 138122 | sqlite3 *db, |
| 138071 | 138123 | const char *zFunc, |
| 138072 | 138124 | int nArg, |
| 138073 | 138125 | int enc, |
| 138074 | 138126 | void *p, |
| @@ -138107,11 +138159,11 @@ | ||
| 138107 | 138159 | sqlite3_mutex_leave(db->mutex); |
| 138108 | 138160 | return rc; |
| 138109 | 138161 | } |
| 138110 | 138162 | |
| 138111 | 138163 | #ifndef SQLITE_OMIT_UTF16 |
| 138112 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( | |
| 138164 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function16( | |
| 138113 | 138165 | sqlite3 *db, |
| 138114 | 138166 | const void *zFunctionName, |
| 138115 | 138167 | int nArg, |
| 138116 | 138168 | int eTextRep, |
| 138117 | 138169 | void *p, |
| @@ -138147,11 +138199,11 @@ | ||
| 138147 | 138199 | ** When virtual tables intend to provide an overloaded function, they |
| 138148 | 138200 | ** should call this routine to make sure the global function exists. |
| 138149 | 138201 | ** A global function must exist in order for name resolution to work |
| 138150 | 138202 | ** properly. |
| 138151 | 138203 | */ |
| 138152 | -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function( | |
| 138204 | +SQLITE_API int SQLITE_APICALL sqlite3_overload_function( | |
| 138153 | 138205 | sqlite3 *db, |
| 138154 | 138206 | const char *zName, |
| 138155 | 138207 | int nArg |
| 138156 | 138208 | ){ |
| 138157 | 138209 | int rc = SQLITE_OK; |
| @@ -138179,11 +138231,11 @@ | ||
| 138179 | 138231 | ** A NULL trace function means that no tracing is executes. A non-NULL |
| 138180 | 138232 | ** trace is a pointer to a function that is invoked at the start of each |
| 138181 | 138233 | ** SQL statement. |
| 138182 | 138234 | */ |
| 138183 | 138235 | #ifndef SQLITE_OMIT_DEPRECATED |
| 138184 | -SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){ | |
| 138236 | +SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){ | |
| 138185 | 138237 | void *pOld; |
| 138186 | 138238 | |
| 138187 | 138239 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138188 | 138240 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138189 | 138241 | (void)SQLITE_MISUSE_BKPT; |
| @@ -138200,11 +138252,11 @@ | ||
| 138200 | 138252 | } |
| 138201 | 138253 | #endif /* SQLITE_OMIT_DEPRECATED */ |
| 138202 | 138254 | |
| 138203 | 138255 | /* Register a trace callback using the version-2 interface. |
| 138204 | 138256 | */ |
| 138205 | -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( | |
| 138257 | +SQLITE_API int SQLITE_APICALL sqlite3_trace_v2( | |
| 138206 | 138258 | sqlite3 *db, /* Trace this connection */ |
| 138207 | 138259 | unsigned mTrace, /* Mask of events to be traced */ |
| 138208 | 138260 | int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */ |
| 138209 | 138261 | void *pArg /* Context */ |
| 138210 | 138262 | ){ |
| @@ -138228,11 +138280,11 @@ | ||
| 138228 | 138280 | ** |
| 138229 | 138281 | ** A NULL profile function means that no profiling is executes. A non-NULL |
| 138230 | 138282 | ** profile is a pointer to a function that is invoked at the conclusion of |
| 138231 | 138283 | ** each SQL statement that is run. |
| 138232 | 138284 | */ |
| 138233 | -SQLITE_API void *SQLITE_STDCALL sqlite3_profile( | |
| 138285 | +SQLITE_API void *SQLITE_APICALL sqlite3_profile( | |
| 138234 | 138286 | sqlite3 *db, |
| 138235 | 138287 | void (*xProfile)(void*,const char*,sqlite_uint64), |
| 138236 | 138288 | void *pArg |
| 138237 | 138289 | ){ |
| 138238 | 138290 | void *pOld; |
| @@ -138256,11 +138308,11 @@ | ||
| 138256 | 138308 | /* |
| 138257 | 138309 | ** Register a function to be invoked when a transaction commits. |
| 138258 | 138310 | ** If the invoked function returns non-zero, then the commit becomes a |
| 138259 | 138311 | ** rollback. |
| 138260 | 138312 | */ |
| 138261 | -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook( | |
| 138313 | +SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook( | |
| 138262 | 138314 | sqlite3 *db, /* Attach the hook to this database */ |
| 138263 | 138315 | int (*xCallback)(void*), /* Function to invoke on each commit */ |
| 138264 | 138316 | void *pArg /* Argument to the function */ |
| 138265 | 138317 | ){ |
| 138266 | 138318 | void *pOld; |
| @@ -138281,11 +138333,11 @@ | ||
| 138281 | 138333 | |
| 138282 | 138334 | /* |
| 138283 | 138335 | ** Register a callback to be invoked each time a row is updated, |
| 138284 | 138336 | ** inserted or deleted using this database connection. |
| 138285 | 138337 | */ |
| 138286 | -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( | |
| 138338 | +SQLITE_API void *SQLITE_APICALL sqlite3_update_hook( | |
| 138287 | 138339 | sqlite3 *db, /* Attach the hook to this database */ |
| 138288 | 138340 | void (*xCallback)(void*,int,char const *,char const *,sqlite_int64), |
| 138289 | 138341 | void *pArg /* Argument to the function */ |
| 138290 | 138342 | ){ |
| 138291 | 138343 | void *pRet; |
| @@ -138306,11 +138358,11 @@ | ||
| 138306 | 138358 | |
| 138307 | 138359 | /* |
| 138308 | 138360 | ** Register a callback to be invoked each time a transaction is rolled |
| 138309 | 138361 | ** back by this database connection. |
| 138310 | 138362 | */ |
| 138311 | -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook( | |
| 138363 | +SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook( | |
| 138312 | 138364 | sqlite3 *db, /* Attach the hook to this database */ |
| 138313 | 138365 | void (*xCallback)(void*), /* Callback function */ |
| 138314 | 138366 | void *pArg /* Argument to the function */ |
| 138315 | 138367 | ){ |
| 138316 | 138368 | void *pRet; |
| @@ -138332,11 +138384,11 @@ | ||
| 138332 | 138384 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 138333 | 138385 | /* |
| 138334 | 138386 | ** Register a callback to be invoked each time a row is updated, |
| 138335 | 138387 | ** inserted or deleted using this database connection. |
| 138336 | 138388 | */ |
| 138337 | -SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook( | |
| 138389 | +SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook( | |
| 138338 | 138390 | sqlite3 *db, /* Attach the hook to this database */ |
| 138339 | 138391 | void(*xCallback)( /* Callback function */ |
| 138340 | 138392 | void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64), |
| 138341 | 138393 | void *pArg /* First callback argument */ |
| 138342 | 138394 | ){ |
| @@ -138381,11 +138433,11 @@ | ||
| 138381 | 138433 | ** The callback registered by this function replaces any existing callback |
| 138382 | 138434 | ** registered using sqlite3_wal_hook(). Likewise, registering a callback |
| 138383 | 138435 | ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism |
| 138384 | 138436 | ** configured by this function. |
| 138385 | 138437 | */ |
| 138386 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ | |
| 138438 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ | |
| 138387 | 138439 | #ifdef SQLITE_OMIT_WAL |
| 138388 | 138440 | UNUSED_PARAMETER(db); |
| 138389 | 138441 | UNUSED_PARAMETER(nFrame); |
| 138390 | 138442 | #else |
| 138391 | 138443 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -138402,11 +138454,11 @@ | ||
| 138402 | 138454 | |
| 138403 | 138455 | /* |
| 138404 | 138456 | ** Register a callback to be invoked each time a transaction is written |
| 138405 | 138457 | ** into the write-ahead-log by this database connection. |
| 138406 | 138458 | */ |
| 138407 | -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( | |
| 138459 | +SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook( | |
| 138408 | 138460 | sqlite3 *db, /* Attach the hook to this db handle */ |
| 138409 | 138461 | int(*xCallback)(void *, sqlite3*, const char*, int), |
| 138410 | 138462 | void *pArg /* First argument passed to xCallback() */ |
| 138411 | 138463 | ){ |
| 138412 | 138464 | #ifndef SQLITE_OMIT_WAL |
| @@ -138429,11 +138481,11 @@ | ||
| 138429 | 138481 | } |
| 138430 | 138482 | |
| 138431 | 138483 | /* |
| 138432 | 138484 | ** Checkpoint database zDb. |
| 138433 | 138485 | */ |
| 138434 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( | |
| 138486 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2( | |
| 138435 | 138487 | sqlite3 *db, /* Database handle */ |
| 138436 | 138488 | const char *zDb, /* Name of attached database (or NULL) */ |
| 138437 | 138489 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 138438 | 138490 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 138439 | 138491 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -138484,11 +138536,11 @@ | ||
| 138484 | 138536 | /* |
| 138485 | 138537 | ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points |
| 138486 | 138538 | ** to contains a zero-length string, all attached databases are |
| 138487 | 138539 | ** checkpointed. |
| 138488 | 138540 | */ |
| 138489 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ | |
| 138541 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ | |
| 138490 | 138542 | /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to |
| 138491 | 138543 | ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */ |
| 138492 | 138544 | return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0); |
| 138493 | 138545 | } |
| 138494 | 138546 | |
| @@ -138575,11 +138627,11 @@ | ||
| 138575 | 138627 | |
| 138576 | 138628 | /* |
| 138577 | 138629 | ** Return UTF-8 encoded English language explanation of the most recent |
| 138578 | 138630 | ** error. |
| 138579 | 138631 | */ |
| 138580 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){ | |
| 138632 | +SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){ | |
| 138581 | 138633 | const char *z; |
| 138582 | 138634 | if( !db ){ |
| 138583 | 138635 | return sqlite3ErrStr(SQLITE_NOMEM_BKPT); |
| 138584 | 138636 | } |
| 138585 | 138637 | if( !sqlite3SafetyCheckSickOrOk(db) ){ |
| @@ -138603,11 +138655,11 @@ | ||
| 138603 | 138655 | #ifndef SQLITE_OMIT_UTF16 |
| 138604 | 138656 | /* |
| 138605 | 138657 | ** Return UTF-16 encoded English language explanation of the most recent |
| 138606 | 138658 | ** error. |
| 138607 | 138659 | */ |
| 138608 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){ | |
| 138660 | +SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){ | |
| 138609 | 138661 | static const u16 outOfMem[] = { |
| 138610 | 138662 | 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 |
| 138611 | 138663 | }; |
| 138612 | 138664 | static const u16 misuse[] = { |
| 138613 | 138665 | 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', |
| @@ -138648,38 +138700,38 @@ | ||
| 138648 | 138700 | |
| 138649 | 138701 | /* |
| 138650 | 138702 | ** Return the most recent error code generated by an SQLite routine. If NULL is |
| 138651 | 138703 | ** passed to this function, we assume a malloc() failed during sqlite3_open(). |
| 138652 | 138704 | */ |
| 138653 | -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){ | |
| 138705 | +SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){ | |
| 138654 | 138706 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 138655 | 138707 | return SQLITE_MISUSE_BKPT; |
| 138656 | 138708 | } |
| 138657 | 138709 | if( !db || db->mallocFailed ){ |
| 138658 | 138710 | return SQLITE_NOMEM_BKPT; |
| 138659 | 138711 | } |
| 138660 | 138712 | return db->errCode & db->errMask; |
| 138661 | 138713 | } |
| 138662 | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){ | |
| 138714 | +SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){ | |
| 138663 | 138715 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 138664 | 138716 | return SQLITE_MISUSE_BKPT; |
| 138665 | 138717 | } |
| 138666 | 138718 | if( !db || db->mallocFailed ){ |
| 138667 | 138719 | return SQLITE_NOMEM_BKPT; |
| 138668 | 138720 | } |
| 138669 | 138721 | return db->errCode; |
| 138670 | 138722 | } |
| 138671 | -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){ | |
| 138723 | +SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){ | |
| 138672 | 138724 | return db ? db->iSysErrno : 0; |
| 138673 | 138725 | } |
| 138674 | 138726 | |
| 138675 | 138727 | /* |
| 138676 | 138728 | ** Return a string that describes the kind of error specified in the |
| 138677 | 138729 | ** argument. For now, this simply calls the internal sqlite3ErrStr() |
| 138678 | 138730 | ** function. |
| 138679 | 138731 | */ |
| 138680 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){ | |
| 138732 | +SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){ | |
| 138681 | 138733 | return sqlite3ErrStr(rc); |
| 138682 | 138734 | } |
| 138683 | 138735 | |
| 138684 | 138736 | /* |
| 138685 | 138737 | ** Create a new collating function for database "db". The name is zName |
| @@ -138823,11 +138875,11 @@ | ||
| 138823 | 138875 | ** |
| 138824 | 138876 | ** A new lower limit does not shrink existing constructs. |
| 138825 | 138877 | ** It merely prevents new constructs that exceed the limit |
| 138826 | 138878 | ** from forming. |
| 138827 | 138879 | */ |
| 138828 | -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ | |
| 138880 | +SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ | |
| 138829 | 138881 | int oldLimit; |
| 138830 | 138882 | |
| 138831 | 138883 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138832 | 138884 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138833 | 138885 | (void)SQLITE_MISUSE_BKPT; |
| @@ -139447,18 +139499,18 @@ | ||
| 139447 | 139499 | } |
| 139448 | 139500 | |
| 139449 | 139501 | /* |
| 139450 | 139502 | ** Open a new database handle. |
| 139451 | 139503 | */ |
| 139452 | -SQLITE_API int SQLITE_STDCALL sqlite3_open( | |
| 139504 | +SQLITE_API int SQLITE_APICALL sqlite3_open( | |
| 139453 | 139505 | const char *zFilename, |
| 139454 | 139506 | sqlite3 **ppDb |
| 139455 | 139507 | ){ |
| 139456 | 139508 | return openDatabase(zFilename, ppDb, |
| 139457 | 139509 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); |
| 139458 | 139510 | } |
| 139459 | -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( | |
| 139511 | +SQLITE_API int SQLITE_APICALL sqlite3_open_v2( | |
| 139460 | 139512 | const char *filename, /* Database filename (UTF-8) */ |
| 139461 | 139513 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 139462 | 139514 | int flags, /* Flags */ |
| 139463 | 139515 | const char *zVfs /* Name of VFS module to use */ |
| 139464 | 139516 | ){ |
| @@ -139467,11 +139519,11 @@ | ||
| 139467 | 139519 | |
| 139468 | 139520 | #ifndef SQLITE_OMIT_UTF16 |
| 139469 | 139521 | /* |
| 139470 | 139522 | ** Open a new database handle. |
| 139471 | 139523 | */ |
| 139472 | -SQLITE_API int SQLITE_STDCALL sqlite3_open16( | |
| 139524 | +SQLITE_API int SQLITE_APICALL sqlite3_open16( | |
| 139473 | 139525 | const void *zFilename, |
| 139474 | 139526 | sqlite3 **ppDb |
| 139475 | 139527 | ){ |
| 139476 | 139528 | char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ |
| 139477 | 139529 | sqlite3_value *pVal; |
| @@ -139506,11 +139558,11 @@ | ||
| 139506 | 139558 | #endif /* SQLITE_OMIT_UTF16 */ |
| 139507 | 139559 | |
| 139508 | 139560 | /* |
| 139509 | 139561 | ** Register a new collation sequence with the database handle db. |
| 139510 | 139562 | */ |
| 139511 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( | |
| 139563 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation( | |
| 139512 | 139564 | sqlite3* db, |
| 139513 | 139565 | const char *zName, |
| 139514 | 139566 | int enc, |
| 139515 | 139567 | void* pCtx, |
| 139516 | 139568 | int(*xCompare)(void*,int,const void*,int,const void*) |
| @@ -139519,11 +139571,11 @@ | ||
| 139519 | 139571 | } |
| 139520 | 139572 | |
| 139521 | 139573 | /* |
| 139522 | 139574 | ** Register a new collation sequence with the database handle db. |
| 139523 | 139575 | */ |
| 139524 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( | |
| 139576 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2( | |
| 139525 | 139577 | sqlite3* db, |
| 139526 | 139578 | const char *zName, |
| 139527 | 139579 | int enc, |
| 139528 | 139580 | void* pCtx, |
| 139529 | 139581 | int(*xCompare)(void*,int,const void*,int,const void*), |
| @@ -139544,11 +139596,11 @@ | ||
| 139544 | 139596 | |
| 139545 | 139597 | #ifndef SQLITE_OMIT_UTF16 |
| 139546 | 139598 | /* |
| 139547 | 139599 | ** Register a new collation sequence with the database handle db. |
| 139548 | 139600 | */ |
| 139549 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( | |
| 139601 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation16( | |
| 139550 | 139602 | sqlite3* db, |
| 139551 | 139603 | const void *zName, |
| 139552 | 139604 | int enc, |
| 139553 | 139605 | void* pCtx, |
| 139554 | 139606 | int(*xCompare)(void*,int,const void*,int,const void*) |
| @@ -139574,11 +139626,11 @@ | ||
| 139574 | 139626 | |
| 139575 | 139627 | /* |
| 139576 | 139628 | ** Register a collation sequence factory callback with the database handle |
| 139577 | 139629 | ** db. Replace any previously installed collation sequence factory. |
| 139578 | 139630 | */ |
| 139579 | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( | |
| 139631 | +SQLITE_API int SQLITE_APICALL sqlite3_collation_needed( | |
| 139580 | 139632 | sqlite3 *db, |
| 139581 | 139633 | void *pCollNeededArg, |
| 139582 | 139634 | void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) |
| 139583 | 139635 | ){ |
| 139584 | 139636 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -139595,11 +139647,11 @@ | ||
| 139595 | 139647 | #ifndef SQLITE_OMIT_UTF16 |
| 139596 | 139648 | /* |
| 139597 | 139649 | ** Register a collation sequence factory callback with the database handle |
| 139598 | 139650 | ** db. Replace any previously installed collation sequence factory. |
| 139599 | 139651 | */ |
| 139600 | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( | |
| 139652 | +SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16( | |
| 139601 | 139653 | sqlite3 *db, |
| 139602 | 139654 | void *pCollNeededArg, |
| 139603 | 139655 | void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) |
| 139604 | 139656 | ){ |
| 139605 | 139657 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -139617,11 +139669,11 @@ | ||
| 139617 | 139669 | #ifndef SQLITE_OMIT_DEPRECATED |
| 139618 | 139670 | /* |
| 139619 | 139671 | ** This function is now an anachronism. It used to be used to recover from a |
| 139620 | 139672 | ** malloc() failure, but SQLite now does this automatically. |
| 139621 | 139673 | */ |
| 139622 | -SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){ | |
| 139674 | +SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){ | |
| 139623 | 139675 | return SQLITE_OK; |
| 139624 | 139676 | } |
| 139625 | 139677 | #endif |
| 139626 | 139678 | |
| 139627 | 139679 | /* |
| @@ -139628,11 +139680,11 @@ | ||
| 139628 | 139680 | ** Test to see whether or not the database connection is in autocommit |
| 139629 | 139681 | ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on |
| 139630 | 139682 | ** by default. Autocommit is disabled by a BEGIN statement and reenabled |
| 139631 | 139683 | ** by the next COMMIT or ROLLBACK. |
| 139632 | 139684 | */ |
| 139633 | -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){ | |
| 139685 | +SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){ | |
| 139634 | 139686 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139635 | 139687 | if( !sqlite3SafetyCheckOk(db) ){ |
| 139636 | 139688 | (void)SQLITE_MISUSE_BKPT; |
| 139637 | 139689 | return 0; |
| 139638 | 139690 | } |
| @@ -139685,19 +139737,19 @@ | ||
| 139685 | 139737 | ** data for this thread has been deallocated. |
| 139686 | 139738 | ** |
| 139687 | 139739 | ** SQLite no longer uses thread-specific data so this routine is now a |
| 139688 | 139740 | ** no-op. It is retained for historical compatibility. |
| 139689 | 139741 | */ |
| 139690 | -SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){ | |
| 139742 | +SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){ | |
| 139691 | 139743 | } |
| 139692 | 139744 | #endif |
| 139693 | 139745 | |
| 139694 | 139746 | /* |
| 139695 | 139747 | ** Return meta information about a specific column of a database table. |
| 139696 | 139748 | ** See comment in sqlite3.h (sqlite.h.in) for details. |
| 139697 | 139749 | */ |
| 139698 | -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( | |
| 139750 | +SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata( | |
| 139699 | 139751 | sqlite3 *db, /* Connection handle */ |
| 139700 | 139752 | const char *zDbName, /* Database name or NULL */ |
| 139701 | 139753 | const char *zTableName, /* Table name */ |
| 139702 | 139754 | const char *zColumnName, /* Column name */ |
| 139703 | 139755 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -139811,11 +139863,11 @@ | ||
| 139811 | 139863 | } |
| 139812 | 139864 | |
| 139813 | 139865 | /* |
| 139814 | 139866 | ** Sleep for a little while. Return the amount of time slept. |
| 139815 | 139867 | */ |
| 139816 | -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){ | |
| 139868 | +SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){ | |
| 139817 | 139869 | sqlite3_vfs *pVfs; |
| 139818 | 139870 | int rc; |
| 139819 | 139871 | pVfs = sqlite3_vfs_find(0); |
| 139820 | 139872 | if( pVfs==0 ) return 0; |
| 139821 | 139873 | |
| @@ -139827,11 +139879,11 @@ | ||
| 139827 | 139879 | } |
| 139828 | 139880 | |
| 139829 | 139881 | /* |
| 139830 | 139882 | ** Enable or disable the extended result codes. |
| 139831 | 139883 | */ |
| 139832 | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){ | |
| 139884 | +SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){ | |
| 139833 | 139885 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139834 | 139886 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 139835 | 139887 | #endif |
| 139836 | 139888 | sqlite3_mutex_enter(db->mutex); |
| 139837 | 139889 | db->errMask = onoff ? 0xffffffff : 0xff; |
| @@ -139840,11 +139892,11 @@ | ||
| 139840 | 139892 | } |
| 139841 | 139893 | |
| 139842 | 139894 | /* |
| 139843 | 139895 | ** Invoke the xFileControl method on a particular database. |
| 139844 | 139896 | */ |
| 139845 | -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ | |
| 139897 | +SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ | |
| 139846 | 139898 | int rc = SQLITE_ERROR; |
| 139847 | 139899 | Btree *pBtree; |
| 139848 | 139900 | |
| 139849 | 139901 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139850 | 139902 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| @@ -140225,11 +140277,11 @@ | ||
| 140225 | 140277 | ** method of a VFS implementation. The zParam argument is the name of the |
| 140226 | 140278 | ** query parameter we seek. This routine returns the value of the zParam |
| 140227 | 140279 | ** parameter if it exists. If the parameter does not exist, this routine |
| 140228 | 140280 | ** returns a NULL pointer. |
| 140229 | 140281 | */ |
| 140230 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){ | |
| 140282 | +SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){ | |
| 140231 | 140283 | if( zFilename==0 || zParam==0 ) return 0; |
| 140232 | 140284 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 140233 | 140285 | while( zFilename[0] ){ |
| 140234 | 140286 | int x = strcmp(zFilename, zParam); |
| 140235 | 140287 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| @@ -140240,20 +140292,20 @@ | ||
| 140240 | 140292 | } |
| 140241 | 140293 | |
| 140242 | 140294 | /* |
| 140243 | 140295 | ** Return a boolean value for a query parameter. |
| 140244 | 140296 | */ |
| 140245 | -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ | |
| 140297 | +SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ | |
| 140246 | 140298 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| 140247 | 140299 | bDflt = bDflt!=0; |
| 140248 | 140300 | return z ? sqlite3GetBoolean(z, bDflt) : bDflt; |
| 140249 | 140301 | } |
| 140250 | 140302 | |
| 140251 | 140303 | /* |
| 140252 | 140304 | ** Return a 64-bit integer value for a query parameter. |
| 140253 | 140305 | */ |
| 140254 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64( | |
| 140306 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64( | |
| 140255 | 140307 | const char *zFilename, /* Filename as passed to xOpen */ |
| 140256 | 140308 | const char *zParam, /* URI parameter sought */ |
| 140257 | 140309 | sqlite3_int64 bDflt /* return if parameter is missing */ |
| 140258 | 140310 | ){ |
| 140259 | 140311 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| @@ -140281,11 +140333,11 @@ | ||
| 140281 | 140333 | |
| 140282 | 140334 | /* |
| 140283 | 140335 | ** Return the filename of the database associated with a database |
| 140284 | 140336 | ** connection. |
| 140285 | 140337 | */ |
| 140286 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){ | |
| 140338 | +SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){ | |
| 140287 | 140339 | Btree *pBt; |
| 140288 | 140340 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140289 | 140341 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140290 | 140342 | (void)SQLITE_MISUSE_BKPT; |
| 140291 | 140343 | return 0; |
| @@ -140297,11 +140349,11 @@ | ||
| 140297 | 140349 | |
| 140298 | 140350 | /* |
| 140299 | 140351 | ** Return 1 if database is read-only or 0 if read/write. Return -1 if |
| 140300 | 140352 | ** no such database exists. |
| 140301 | 140353 | */ |
| 140302 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ | |
| 140354 | +SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ | |
| 140303 | 140355 | Btree *pBt; |
| 140304 | 140356 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140305 | 140357 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140306 | 140358 | (void)SQLITE_MISUSE_BKPT; |
| 140307 | 140359 | return -1; |
| @@ -140314,11 +140366,11 @@ | ||
| 140314 | 140366 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 140315 | 140367 | /* |
| 140316 | 140368 | ** Obtain a snapshot handle for the snapshot of database zDb currently |
| 140317 | 140369 | ** being read by handle db. |
| 140318 | 140370 | */ |
| 140319 | -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get( | |
| 140371 | +SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get( | |
| 140320 | 140372 | sqlite3 *db, |
| 140321 | 140373 | const char *zDb, |
| 140322 | 140374 | sqlite3_snapshot **ppSnapshot |
| 140323 | 140375 | ){ |
| 140324 | 140376 | int rc = SQLITE_ERROR; |
| @@ -140349,11 +140401,11 @@ | ||
| 140349 | 140401 | } |
| 140350 | 140402 | |
| 140351 | 140403 | /* |
| 140352 | 140404 | ** Open a read-transaction on the snapshot idendified by pSnapshot. |
| 140353 | 140405 | */ |
| 140354 | -SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open( | |
| 140406 | +SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open( | |
| 140355 | 140407 | sqlite3 *db, |
| 140356 | 140408 | const char *zDb, |
| 140357 | 140409 | sqlite3_snapshot *pSnapshot |
| 140358 | 140410 | ){ |
| 140359 | 140411 | int rc = SQLITE_ERROR; |
| @@ -140386,11 +140438,11 @@ | ||
| 140386 | 140438 | } |
| 140387 | 140439 | |
| 140388 | 140440 | /* |
| 140389 | 140441 | ** Free a snapshot handle obtained from sqlite3_snapshot_get(). |
| 140390 | 140442 | */ |
| 140391 | -SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){ | |
| 140443 | +SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){ | |
| 140392 | 140444 | sqlite3_free(pSnapshot); |
| 140393 | 140445 | } |
| 140394 | 140446 | #endif /* SQLITE_ENABLE_SNAPSHOT */ |
| 140395 | 140447 | |
| 140396 | 140448 | /************** End of main.c ************************************************/ |
| @@ -140540,11 +140592,11 @@ | ||
| 140540 | 140592 | ** |
| 140541 | 140593 | ** Each call to this routine overrides any prior callbacks registered |
| 140542 | 140594 | ** on the same "db". If xNotify==0 then any prior callbacks are immediately |
| 140543 | 140595 | ** cancelled. |
| 140544 | 140596 | */ |
| 140545 | -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( | |
| 140597 | +SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify( | |
| 140546 | 140598 | sqlite3 *db, |
| 140547 | 140599 | void (*xNotify)(void **, int), |
| 140548 | 140600 | void *pArg |
| 140549 | 140601 | ){ |
| 140550 | 140602 | int rc = SQLITE_OK; |
| @@ -147543,11 +147595,11 @@ | ||
| 147543 | 147595 | ** Initialize API pointer table, if required. |
| 147544 | 147596 | */ |
| 147545 | 147597 | #ifdef _WIN32 |
| 147546 | 147598 | __declspec(dllexport) |
| 147547 | 147599 | #endif |
| 147548 | -SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init( | |
| 147600 | +SQLITE_API int SQLITE_APICALL sqlite3_fts3_init( | |
| 147549 | 147601 | sqlite3 *db, |
| 147550 | 147602 | char **pzErrMsg, |
| 147551 | 147603 | const sqlite3_api_routines *pApi |
| 147552 | 147604 | ){ |
| 147553 | 147605 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -150699,11 +150751,15 @@ | ||
| 150699 | 150751 | } |
| 150700 | 150752 | |
| 150701 | 150753 | |
| 150702 | 150754 | #ifdef SQLITE_TEST |
| 150703 | 150755 | |
| 150704 | -#include <tcl.h> | |
| 150756 | +#if defined(INCLUDE_SQLITE_TCL_H) | |
| 150757 | +# include "sqlite_tcl.h" | |
| 150758 | +#else | |
| 150759 | +# include "tcl.h" | |
| 150760 | +#endif | |
| 150705 | 150761 | /* #include <string.h> */ |
| 150706 | 150762 | |
| 150707 | 150763 | /* |
| 150708 | 150764 | ** Implementation of a special SQL scalar function for testing tokenizers |
| 150709 | 150765 | ** designed to be used in concert with the Tcl testing framework. This |
| @@ -163340,11 +163396,11 @@ | ||
| 163340 | 163396 | } |
| 163341 | 163397 | |
| 163342 | 163398 | /* |
| 163343 | 163399 | ** Register a new geometry function for use with the r-tree MATCH operator. |
| 163344 | 163400 | */ |
| 163345 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( | |
| 163401 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback( | |
| 163346 | 163402 | sqlite3 *db, /* Register SQL function on this connection */ |
| 163347 | 163403 | const char *zGeom, /* Name of the new SQL function */ |
| 163348 | 163404 | int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */ |
| 163349 | 163405 | void *pContext /* Extra data associated with the callback */ |
| 163350 | 163406 | ){ |
| @@ -163364,11 +163420,11 @@ | ||
| 163364 | 163420 | |
| 163365 | 163421 | /* |
| 163366 | 163422 | ** Register a new 2nd-generation geometry function for use with the |
| 163367 | 163423 | ** r-tree MATCH operator. |
| 163368 | 163424 | */ |
| 163369 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( | |
| 163425 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback( | |
| 163370 | 163426 | sqlite3 *db, /* Register SQL function on this connection */ |
| 163371 | 163427 | const char *zQueryFunc, /* Name of new SQL function */ |
| 163372 | 163428 | int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */ |
| 163373 | 163429 | void *pContext, /* Extra data passed into the callback */ |
| 163374 | 163430 | void (*xDestructor)(void*) /* Destructor for the extra data */ |
| @@ -163389,11 +163445,11 @@ | ||
| 163389 | 163445 | |
| 163390 | 163446 | #if !SQLITE_CORE |
| 163391 | 163447 | #ifdef _WIN32 |
| 163392 | 163448 | __declspec(dllexport) |
| 163393 | 163449 | #endif |
| 163394 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init( | |
| 163450 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_init( | |
| 163395 | 163451 | sqlite3 *db, |
| 163396 | 163452 | char **pzErrMsg, |
| 163397 | 163453 | const sqlite3_api_routines *pApi |
| 163398 | 163454 | ){ |
| 163399 | 163455 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -163940,11 +163996,11 @@ | ||
| 163940 | 163996 | |
| 163941 | 163997 | #if !SQLITE_CORE |
| 163942 | 163998 | #ifdef _WIN32 |
| 163943 | 163999 | __declspec(dllexport) |
| 163944 | 164000 | #endif |
| 163945 | -SQLITE_API int SQLITE_STDCALL sqlite3_icu_init( | |
| 164001 | +SQLITE_API int SQLITE_APICALL sqlite3_icu_init( | |
| 163946 | 164002 | sqlite3 *db, |
| 163947 | 164003 | char **pzErrMsg, |
| 163948 | 164004 | const sqlite3_api_routines *pApi |
| 163949 | 164005 | ){ |
| 163950 | 164006 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -164620,11 +164676,11 @@ | ||
| 164620 | 164676 | ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of |
| 164621 | 164677 | ** SQLite's built-in VFSs, including the multiplexor VFS. However it does |
| 164622 | 164678 | ** not work out of the box with zipvfs. Refer to the comment describing |
| 164623 | 164679 | ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs. |
| 164624 | 164680 | */ |
| 164625 | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open( | |
| 164681 | +SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open( | |
| 164626 | 164682 | const char *zTarget, |
| 164627 | 164683 | const char *zRbu, |
| 164628 | 164684 | const char *zState |
| 164629 | 164685 | ); |
| 164630 | 164686 | |
| @@ -164653,11 +164709,11 @@ | ||
| 164653 | 164709 | ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment |
| 164654 | 164710 | ** describing the sqlite3rbu_create_vfs() API function below for |
| 164655 | 164711 | ** a description of the complications associated with using RBU with |
| 164656 | 164712 | ** zipvfs databases. |
| 164657 | 164713 | */ |
| 164658 | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum( | |
| 164714 | +SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum( | |
| 164659 | 164715 | const char *zTarget, |
| 164660 | 164716 | const char *zState |
| 164661 | 164717 | ); |
| 164662 | 164718 | |
| 164663 | 164719 | /* |
| @@ -164689,11 +164745,11 @@ | ||
| 164689 | 164745 | ** when sqlite3rbu_close() is called. |
| 164690 | 164746 | ** |
| 164691 | 164747 | ** Database handles returned by this function remain valid until the next |
| 164692 | 164748 | ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db(). |
| 164693 | 164749 | */ |
| 164694 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu); | |
| 164750 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu); | |
| 164695 | 164751 | |
| 164696 | 164752 | /* |
| 164697 | 164753 | ** Do some work towards applying the RBU update to the target db. |
| 164698 | 164754 | ** |
| 164699 | 164755 | ** Return SQLITE_DONE if the update has been completely applied, or |
| @@ -164703,11 +164759,11 @@ | ||
| 164703 | 164759 | ** |
| 164704 | 164760 | ** Once a call to sqlite3rbu_step() has returned a value other than |
| 164705 | 164761 | ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops |
| 164706 | 164762 | ** that immediately return the same value. |
| 164707 | 164763 | */ |
| 164708 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu); | |
| 164764 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu); | |
| 164709 | 164765 | |
| 164710 | 164766 | /* |
| 164711 | 164767 | ** Force RBU to save its state to disk. |
| 164712 | 164768 | ** |
| 164713 | 164769 | ** If a power failure or application crash occurs during an update, following |
| @@ -164715,11 +164771,11 @@ | ||
| 164715 | 164771 | ** was last saved. In other words, from the most recent successful call to |
| 164716 | 164772 | ** sqlite3rbu_close() or this function. |
| 164717 | 164773 | ** |
| 164718 | 164774 | ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. |
| 164719 | 164775 | */ |
| 164720 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu); | |
| 164776 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu); | |
| 164721 | 164777 | |
| 164722 | 164778 | /* |
| 164723 | 164779 | ** Close an RBU handle. |
| 164724 | 164780 | ** |
| 164725 | 164781 | ** If the RBU update has been completely applied, mark the RBU database |
| @@ -164735,18 +164791,18 @@ | ||
| 164735 | 164791 | ** |
| 164736 | 164792 | ** Otherwise, if no error occurs, this function returns SQLITE_OK if the |
| 164737 | 164793 | ** update has been partially applied, or SQLITE_DONE if it has been |
| 164738 | 164794 | ** completely applied. |
| 164739 | 164795 | */ |
| 164740 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); | |
| 164796 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); | |
| 164741 | 164797 | |
| 164742 | 164798 | /* |
| 164743 | 164799 | ** Return the total number of key-value operations (inserts, deletes or |
| 164744 | 164800 | ** updates) that have been performed on the target database since the |
| 164745 | 164801 | ** current RBU update was started. |
| 164746 | 164802 | */ |
| 164747 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu); | |
| 164803 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu); | |
| 164748 | 164804 | |
| 164749 | 164805 | /* |
| 164750 | 164806 | ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) |
| 164751 | 164807 | ** progress indications for the two stages of an RBU update. This API may |
| 164752 | 164808 | ** be useful for driving GUI progress indicators and similar. |
| @@ -164784,11 +164840,11 @@ | ||
| 164784 | 164840 | ** permyriadage progress of the same stage. If the rbu_count table does |
| 164785 | 164841 | ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count |
| 164786 | 164842 | ** table exists but is not correctly populated, the value of the *pnOne |
| 164787 | 164843 | ** output variable during stage 1 is undefined. |
| 164788 | 164844 | */ |
| 164789 | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo); | |
| 164845 | +SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo); | |
| 164790 | 164846 | |
| 164791 | 164847 | /* |
| 164792 | 164848 | ** Obtain an indication as to the current stage of an RBU update or vacuum. |
| 164793 | 164849 | ** This function always returns one of the SQLITE_RBU_STATE_XXX constants |
| 164794 | 164850 | ** defined in this file. Return values should be interpreted as follows: |
| @@ -164822,11 +164878,11 @@ | ||
| 164822 | 164878 | #define SQLITE_RBU_STATE_MOVE 2 |
| 164823 | 164879 | #define SQLITE_RBU_STATE_CHECKPOINT 3 |
| 164824 | 164880 | #define SQLITE_RBU_STATE_DONE 4 |
| 164825 | 164881 | #define SQLITE_RBU_STATE_ERROR 5 |
| 164826 | 164882 | |
| 164827 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu); | |
| 164883 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu); | |
| 164828 | 164884 | |
| 164829 | 164885 | /* |
| 164830 | 164886 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 164831 | 164887 | ** via existing VFS zParent. Or, if the zParent parameter is passed NULL, |
| 164832 | 164888 | ** then the new RBU VFS uses the default system VFS to access the file-system. |
| @@ -164866,21 +164922,21 @@ | ||
| 164866 | 164922 | ** The overhead of adding the "rbu" VFS to the system is negligible for |
| 164867 | 164923 | ** non-RBU users. There is no harm in an application accessing the |
| 164868 | 164924 | ** file-system via "rbu" all the time, even if it only uses RBU functionality |
| 164869 | 164925 | ** occasionally. |
| 164870 | 164926 | */ |
| 164871 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent); | |
| 164927 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent); | |
| 164872 | 164928 | |
| 164873 | 164929 | /* |
| 164874 | 164930 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 164875 | 164931 | ** sqlite3rbu_create_vfs(). |
| 164876 | 164932 | ** |
| 164877 | 164933 | ** VFS objects are not reference counted. If a VFS object is destroyed |
| 164878 | 164934 | ** before all database handles that use it have been closed, the results |
| 164879 | 164935 | ** are undefined. |
| 164880 | 164936 | */ |
| 164881 | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName); | |
| 164937 | +SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName); | |
| 164882 | 164938 | |
| 164883 | 164939 | #if 0 |
| 164884 | 164940 | } /* end of the 'extern "C"' block */ |
| 164885 | 164941 | #endif |
| 164886 | 164942 | |
| @@ -167970,11 +168026,11 @@ | ||
| 167970 | 168026 | } |
| 167971 | 168027 | |
| 167972 | 168028 | /* |
| 167973 | 168029 | ** Step the RBU object. |
| 167974 | 168030 | */ |
| 167975 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){ | |
| 168031 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){ | |
| 167976 | 168032 | if( p ){ |
| 167977 | 168033 | switch( p->eStage ){ |
| 167978 | 168034 | case RBU_STAGE_OAL: { |
| 167979 | 168035 | RbuObjIter *pIter = &p->objiter; |
| 167980 | 168036 | |
| @@ -168412,11 +168468,11 @@ | ||
| 168412 | 168468 | } |
| 168413 | 168469 | |
| 168414 | 168470 | /* |
| 168415 | 168471 | ** Open and return a new RBU handle. |
| 168416 | 168472 | */ |
| 168417 | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open( | |
| 168473 | +SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open( | |
| 168418 | 168474 | const char *zTarget, |
| 168419 | 168475 | const char *zRbu, |
| 168420 | 168476 | const char *zState |
| 168421 | 168477 | ){ |
| 168422 | 168478 | /* TODO: Check that zTarget and zRbu are non-NULL */ |
| @@ -168424,11 +168480,11 @@ | ||
| 168424 | 168480 | } |
| 168425 | 168481 | |
| 168426 | 168482 | /* |
| 168427 | 168483 | ** Open a handle to begin or resume an RBU VACUUM operation. |
| 168428 | 168484 | */ |
| 168429 | -SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum( | |
| 168485 | +SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum( | |
| 168430 | 168486 | const char *zTarget, |
| 168431 | 168487 | const char *zState |
| 168432 | 168488 | ){ |
| 168433 | 168489 | /* TODO: Check that both arguments are non-NULL */ |
| 168434 | 168490 | return openRbuHandle(0, zTarget, zState); |
| @@ -168435,11 +168491,11 @@ | ||
| 168435 | 168491 | } |
| 168436 | 168492 | |
| 168437 | 168493 | /* |
| 168438 | 168494 | ** Return the database handle used by pRbu. |
| 168439 | 168495 | */ |
| 168440 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){ | |
| 168496 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){ | |
| 168441 | 168497 | sqlite3 *db = 0; |
| 168442 | 168498 | if( pRbu ){ |
| 168443 | 168499 | db = (bRbu ? pRbu->dbRbu : pRbu->dbMain); |
| 168444 | 168500 | } |
| 168445 | 168501 | return db; |
| @@ -168467,11 +168523,11 @@ | ||
| 168467 | 168523 | } |
| 168468 | 168524 | |
| 168469 | 168525 | /* |
| 168470 | 168526 | ** Close the RBU handle. |
| 168471 | 168527 | */ |
| 168472 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ | |
| 168528 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ | |
| 168473 | 168529 | int rc; |
| 168474 | 168530 | if( p ){ |
| 168475 | 168531 | |
| 168476 | 168532 | /* Commit the transaction to the *-oal file. */ |
| 168477 | 168533 | if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){ |
| @@ -168518,19 +168574,19 @@ | ||
| 168518 | 168574 | /* |
| 168519 | 168575 | ** Return the total number of key-value operations (inserts, deletes or |
| 168520 | 168576 | ** updates) that have been performed on the target database since the |
| 168521 | 168577 | ** current RBU update was started. |
| 168522 | 168578 | */ |
| 168523 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){ | |
| 168579 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){ | |
| 168524 | 168580 | return pRbu->nProgress; |
| 168525 | 168581 | } |
| 168526 | 168582 | |
| 168527 | 168583 | /* |
| 168528 | 168584 | ** Return permyriadage progress indications for the two main stages of |
| 168529 | 168585 | ** an RBU update. |
| 168530 | 168586 | */ |
| 168531 | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){ | |
| 168587 | +SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){ | |
| 168532 | 168588 | const int MAX_PROGRESS = 10000; |
| 168533 | 168589 | switch( p->eStage ){ |
| 168534 | 168590 | case RBU_STAGE_OAL: |
| 168535 | 168591 | if( p->nPhaseOneStep>0 ){ |
| 168536 | 168592 | *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep); |
| @@ -168561,11 +168617,11 @@ | ||
| 168561 | 168617 | } |
| 168562 | 168618 | |
| 168563 | 168619 | /* |
| 168564 | 168620 | ** Return the current state of the RBU vacuum or update operation. |
| 168565 | 168621 | */ |
| 168566 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){ | |
| 168622 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){ | |
| 168567 | 168623 | int aRes[] = { |
| 168568 | 168624 | 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE, |
| 168569 | 168625 | 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE |
| 168570 | 168626 | }; |
| 168571 | 168627 | |
| @@ -168589,11 +168645,11 @@ | ||
| 168589 | 168645 | ); |
| 168590 | 168646 | return aRes[p->eStage]; |
| 168591 | 168647 | } |
| 168592 | 168648 | } |
| 168593 | 168649 | |
| 168594 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){ | |
| 168650 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){ | |
| 168595 | 168651 | int rc = p->rc; |
| 168596 | 168652 | if( rc==SQLITE_DONE ) return SQLITE_OK; |
| 168597 | 168653 | |
| 168598 | 168654 | assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE ); |
| 168599 | 168655 | if( p->eStage==RBU_STAGE_OAL ){ |
| @@ -169416,11 +169472,11 @@ | ||
| 169416 | 169472 | |
| 169417 | 169473 | /* |
| 169418 | 169474 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 169419 | 169475 | ** sqlite3rbu_create_vfs(). |
| 169420 | 169476 | */ |
| 169421 | -SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){ | |
| 169477 | +SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){ | |
| 169422 | 169478 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zName); |
| 169423 | 169479 | if( pVfs && pVfs->xOpen==rbuVfsOpen ){ |
| 169424 | 169480 | sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex); |
| 169425 | 169481 | sqlite3_vfs_unregister(pVfs); |
| 169426 | 169482 | sqlite3_free(pVfs); |
| @@ -169430,11 +169486,11 @@ | ||
| 169430 | 169486 | /* |
| 169431 | 169487 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 169432 | 169488 | ** via existing VFS zParent. The new object is registered as a non-default |
| 169433 | 169489 | ** VFS with SQLite before returning. |
| 169434 | 169490 | */ |
| 169435 | -SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){ | |
| 169491 | +SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){ | |
| 169436 | 169492 | |
| 169437 | 169493 | /* Template for VFS */ |
| 169438 | 169494 | static sqlite3_vfs vfs_template = { |
| 169439 | 169495 | 1, /* iVersion */ |
| 169440 | 169496 | 0, /* szOsFile */ |
| @@ -171675,11 +171731,11 @@ | ||
| 171675 | 171731 | } |
| 171676 | 171732 | |
| 171677 | 171733 | return rc; |
| 171678 | 171734 | } |
| 171679 | 171735 | |
| 171680 | -SQLITE_API int SQLITE_STDCALL sqlite3session_diff( | |
| 171736 | +SQLITE_API int SQLITE_APICALL sqlite3session_diff( | |
| 171681 | 171737 | sqlite3_session *pSession, |
| 171682 | 171738 | const char *zFrom, |
| 171683 | 171739 | const char *zTbl, |
| 171684 | 171740 | char **pzErrMsg |
| 171685 | 171741 | ){ |
| @@ -171769,11 +171825,11 @@ | ||
| 171769 | 171825 | |
| 171770 | 171826 | /* |
| 171771 | 171827 | ** Create a session object. This session object will record changes to |
| 171772 | 171828 | ** database zDb attached to connection db. |
| 171773 | 171829 | */ |
| 171774 | -SQLITE_API int SQLITE_STDCALL sqlite3session_create( | |
| 171830 | +SQLITE_API int SQLITE_APICALL sqlite3session_create( | |
| 171775 | 171831 | sqlite3 *db, /* Database handle */ |
| 171776 | 171832 | const char *zDb, /* Name of db (e.g. "main") */ |
| 171777 | 171833 | sqlite3_session **ppSession /* OUT: New session object */ |
| 171778 | 171834 | ){ |
| 171779 | 171835 | sqlite3_session *pNew; /* Newly allocated session object */ |
| @@ -171831,11 +171887,11 @@ | ||
| 171831 | 171887 | } |
| 171832 | 171888 | |
| 171833 | 171889 | /* |
| 171834 | 171890 | ** Delete a session object previously allocated using sqlite3session_create(). |
| 171835 | 171891 | */ |
| 171836 | -SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){ | |
| 171892 | +SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){ | |
| 171837 | 171893 | sqlite3 *db = pSession->db; |
| 171838 | 171894 | sqlite3_session *pHead; |
| 171839 | 171895 | sqlite3_session **pp; |
| 171840 | 171896 | |
| 171841 | 171897 | /* Unlink the session from the linked list of sessions attached to the |
| @@ -171860,11 +171916,11 @@ | ||
| 171860 | 171916 | } |
| 171861 | 171917 | |
| 171862 | 171918 | /* |
| 171863 | 171919 | ** Set a table filter on a Session Object. |
| 171864 | 171920 | */ |
| 171865 | -SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter( | |
| 171921 | +SQLITE_API void SQLITE_APICALL sqlite3session_table_filter( | |
| 171866 | 171922 | sqlite3_session *pSession, |
| 171867 | 171923 | int(*xFilter)(void*, const char*), |
| 171868 | 171924 | void *pCtx /* First argument passed to xFilter */ |
| 171869 | 171925 | ){ |
| 171870 | 171926 | pSession->bAutoAttach = 1; |
| @@ -171878,11 +171934,11 @@ | ||
| 171878 | 171934 | ** |
| 171879 | 171935 | ** Only tables that have a PRIMARY KEY defined may be attached. It does |
| 171880 | 171936 | ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) |
| 171881 | 171937 | ** or not. |
| 171882 | 171938 | */ |
| 171883 | -SQLITE_API int SQLITE_STDCALL sqlite3session_attach( | |
| 171939 | +SQLITE_API int SQLITE_APICALL sqlite3session_attach( | |
| 171884 | 171940 | sqlite3_session *pSession, /* Session object */ |
| 171885 | 171941 | const char *zName /* Table name */ |
| 171886 | 171942 | ){ |
| 171887 | 171943 | int rc = SQLITE_OK; |
| 171888 | 171944 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| @@ -172568,11 +172624,11 @@ | ||
| 172568 | 172624 | ** session object passed as the first argument. |
| 172569 | 172625 | ** |
| 172570 | 172626 | ** It is the responsibility of the caller to eventually free the buffer |
| 172571 | 172627 | ** using sqlite3_free(). |
| 172572 | 172628 | */ |
| 172573 | -SQLITE_API int SQLITE_STDCALL sqlite3session_changeset( | |
| 172629 | +SQLITE_API int SQLITE_APICALL sqlite3session_changeset( | |
| 172574 | 172630 | sqlite3_session *pSession, /* Session object */ |
| 172575 | 172631 | int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ |
| 172576 | 172632 | void **ppChangeset /* OUT: Buffer containing changeset */ |
| 172577 | 172633 | ){ |
| 172578 | 172634 | return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset); |
| @@ -172579,11 +172635,11 @@ | ||
| 172579 | 172635 | } |
| 172580 | 172636 | |
| 172581 | 172637 | /* |
| 172582 | 172638 | ** Streaming version of sqlite3session_changeset(). |
| 172583 | 172639 | */ |
| 172584 | -SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm( | |
| 172640 | +SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm( | |
| 172585 | 172641 | sqlite3_session *pSession, |
| 172586 | 172642 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 172587 | 172643 | void *pOut |
| 172588 | 172644 | ){ |
| 172589 | 172645 | return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0); |
| @@ -172590,11 +172646,11 @@ | ||
| 172590 | 172646 | } |
| 172591 | 172647 | |
| 172592 | 172648 | /* |
| 172593 | 172649 | ** Streaming version of sqlite3session_patchset(). |
| 172594 | 172650 | */ |
| 172595 | -SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm( | |
| 172651 | +SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm( | |
| 172596 | 172652 | sqlite3_session *pSession, |
| 172597 | 172653 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 172598 | 172654 | void *pOut |
| 172599 | 172655 | ){ |
| 172600 | 172656 | return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0); |
| @@ -172605,11 +172661,11 @@ | ||
| 172605 | 172661 | ** session object passed as the first argument. |
| 172606 | 172662 | ** |
| 172607 | 172663 | ** It is the responsibility of the caller to eventually free the buffer |
| 172608 | 172664 | ** using sqlite3_free(). |
| 172609 | 172665 | */ |
| 172610 | -SQLITE_API int SQLITE_STDCALL sqlite3session_patchset( | |
| 172666 | +SQLITE_API int SQLITE_APICALL sqlite3session_patchset( | |
| 172611 | 172667 | sqlite3_session *pSession, /* Session object */ |
| 172612 | 172668 | int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */ |
| 172613 | 172669 | void **ppPatchset /* OUT: Buffer containing changeset */ |
| 172614 | 172670 | ){ |
| 172615 | 172671 | return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset); |
| @@ -172616,11 +172672,11 @@ | ||
| 172616 | 172672 | } |
| 172617 | 172673 | |
| 172618 | 172674 | /* |
| 172619 | 172675 | ** Enable or disable the session object passed as the first argument. |
| 172620 | 172676 | */ |
| 172621 | -SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){ | |
| 172677 | +SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){ | |
| 172622 | 172678 | int ret; |
| 172623 | 172679 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172624 | 172680 | if( bEnable>=0 ){ |
| 172625 | 172681 | pSession->bEnable = bEnable; |
| 172626 | 172682 | } |
| @@ -172630,11 +172686,11 @@ | ||
| 172630 | 172686 | } |
| 172631 | 172687 | |
| 172632 | 172688 | /* |
| 172633 | 172689 | ** Enable or disable the session object passed as the first argument. |
| 172634 | 172690 | */ |
| 172635 | -SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){ | |
| 172691 | +SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){ | |
| 172636 | 172692 | int ret; |
| 172637 | 172693 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172638 | 172694 | if( bIndirect>=0 ){ |
| 172639 | 172695 | pSession->bIndirect = bIndirect; |
| 172640 | 172696 | } |
| @@ -172645,11 +172701,11 @@ | ||
| 172645 | 172701 | |
| 172646 | 172702 | /* |
| 172647 | 172703 | ** Return true if there have been no changes to monitored tables recorded |
| 172648 | 172704 | ** by the session object passed as the only argument. |
| 172649 | 172705 | */ |
| 172650 | -SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){ | |
| 172706 | +SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){ | |
| 172651 | 172707 | int ret = 0; |
| 172652 | 172708 | SessionTable *pTab; |
| 172653 | 172709 | |
| 172654 | 172710 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172655 | 172711 | for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){ |
| @@ -172695,11 +172751,11 @@ | ||
| 172695 | 172751 | } |
| 172696 | 172752 | |
| 172697 | 172753 | /* |
| 172698 | 172754 | ** Create an iterator used to iterate through the contents of a changeset. |
| 172699 | 172755 | */ |
| 172700 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_start( | |
| 172756 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_start( | |
| 172701 | 172757 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 172702 | 172758 | int nChangeset, /* Size of buffer pChangeset in bytes */ |
| 172703 | 172759 | void *pChangeset /* Pointer to buffer containing changeset */ |
| 172704 | 172760 | ){ |
| 172705 | 172761 | return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset); |
| @@ -172706,11 +172762,11 @@ | ||
| 172706 | 172762 | } |
| 172707 | 172763 | |
| 172708 | 172764 | /* |
| 172709 | 172765 | ** Streaming version of sqlite3changeset_start(). |
| 172710 | 172766 | */ |
| 172711 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm( | |
| 172767 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm( | |
| 172712 | 172768 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 172713 | 172769 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 172714 | 172770 | void *pIn |
| 172715 | 172771 | ){ |
| 172716 | 172772 | return sessionChangesetStart(pp, xInput, pIn, 0, 0); |
| @@ -173127,20 +173183,20 @@ | ||
| 173127 | 173183 | ** or SQLITE_CORRUPT. |
| 173128 | 173184 | ** |
| 173129 | 173185 | ** This function may not be called on iterators passed to a conflict handler |
| 173130 | 173186 | ** callback by changeset_apply(). |
| 173131 | 173187 | */ |
| 173132 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){ | |
| 173188 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){ | |
| 173133 | 173189 | return sessionChangesetNext(p, 0, 0); |
| 173134 | 173190 | } |
| 173135 | 173191 | |
| 173136 | 173192 | /* |
| 173137 | 173193 | ** The following function extracts information on the current change |
| 173138 | 173194 | ** from a changeset iterator. It may only be called after changeset_next() |
| 173139 | 173195 | ** has returned SQLITE_ROW. |
| 173140 | 173196 | */ |
| 173141 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_op( | |
| 173197 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_op( | |
| 173142 | 173198 | sqlite3_changeset_iter *pIter, /* Iterator handle */ |
| 173143 | 173199 | const char **pzTab, /* OUT: Pointer to table name */ |
| 173144 | 173200 | int *pnCol, /* OUT: Number of columns in table */ |
| 173145 | 173201 | int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ |
| 173146 | 173202 | int *pbIndirect /* OUT: True if change is indirect */ |
| @@ -173156,11 +173212,11 @@ | ||
| 173156 | 173212 | ** Return information regarding the PRIMARY KEY and number of columns in |
| 173157 | 173213 | ** the database table affected by the change that pIter currently points |
| 173158 | 173214 | ** to. This function may only be called after changeset_next() returns |
| 173159 | 173215 | ** SQLITE_ROW. |
| 173160 | 173216 | */ |
| 173161 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk( | |
| 173217 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_pk( | |
| 173162 | 173218 | sqlite3_changeset_iter *pIter, /* Iterator object */ |
| 173163 | 173219 | unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ |
| 173164 | 173220 | int *pnCol /* OUT: Number of entries in output array */ |
| 173165 | 173221 | ){ |
| 173166 | 173222 | *pabPK = pIter->abPK; |
| @@ -173179,11 +173235,11 @@ | ||
| 173179 | 173235 | ** was not modified and is not a PK column), set *ppValue to NULL. |
| 173180 | 173236 | ** |
| 173181 | 173237 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 173182 | 173238 | ** not modified. Otherwise, SQLITE_OK. |
| 173183 | 173239 | */ |
| 173184 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_old( | |
| 173240 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_old( | |
| 173185 | 173241 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173186 | 173242 | int iVal, /* Index of old.* value to retrieve */ |
| 173187 | 173243 | sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ |
| 173188 | 173244 | ){ |
| 173189 | 173245 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){ |
| @@ -173207,11 +173263,11 @@ | ||
| 173207 | 173263 | ** was not modified), set *ppValue to NULL. |
| 173208 | 173264 | ** |
| 173209 | 173265 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 173210 | 173266 | ** not modified. Otherwise, SQLITE_OK. |
| 173211 | 173267 | */ |
| 173212 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_new( | |
| 173268 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_new( | |
| 173213 | 173269 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173214 | 173270 | int iVal, /* Index of new.* value to retrieve */ |
| 173215 | 173271 | sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ |
| 173216 | 173272 | ){ |
| 173217 | 173273 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){ |
| @@ -173241,11 +173297,11 @@ | ||
| 173241 | 173297 | ** containing the iVal'th value of the conflicting record. |
| 173242 | 173298 | ** |
| 173243 | 173299 | ** If value iVal is out-of-range or some other error occurs, an SQLite error |
| 173244 | 173300 | ** code is returned. Otherwise, SQLITE_OK. |
| 173245 | 173301 | */ |
| 173246 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict( | |
| 173302 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict( | |
| 173247 | 173303 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173248 | 173304 | int iVal, /* Index of conflict record value to fetch */ |
| 173249 | 173305 | sqlite3_value **ppValue /* OUT: Value from conflicting row */ |
| 173250 | 173306 | ){ |
| 173251 | 173307 | if( !pIter->pConflict ){ |
| @@ -173264,11 +173320,11 @@ | ||
| 173264 | 173320 | ** it sets the output variable to the total number of known foreign key |
| 173265 | 173321 | ** violations in the destination database and returns SQLITE_OK. |
| 173266 | 173322 | ** |
| 173267 | 173323 | ** In all other cases this function returns SQLITE_MISUSE. |
| 173268 | 173324 | */ |
| 173269 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts( | |
| 173325 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts( | |
| 173270 | 173326 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173271 | 173327 | int *pnOut /* OUT: Number of FK violations */ |
| 173272 | 173328 | ){ |
| 173273 | 173329 | if( pIter->pConflict || pIter->apValue ){ |
| 173274 | 173330 | return SQLITE_MISUSE; |
| @@ -173282,11 +173338,11 @@ | ||
| 173282 | 173338 | ** Finalize an iterator allocated with sqlite3changeset_start(). |
| 173283 | 173339 | ** |
| 173284 | 173340 | ** This function may not be called on iterators passed to a conflict handler |
| 173285 | 173341 | ** callback by changeset_apply(). |
| 173286 | 173342 | */ |
| 173287 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){ | |
| 173343 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){ | |
| 173288 | 173344 | int rc = SQLITE_OK; |
| 173289 | 173345 | if( p ){ |
| 173290 | 173346 | int i; /* Used to iterate through p->apValue[] */ |
| 173291 | 173347 | rc = p->rc; |
| 173292 | 173348 | if( p->apValue ){ |
| @@ -173456,11 +173512,11 @@ | ||
| 173456 | 173512 | |
| 173457 | 173513 | |
| 173458 | 173514 | /* |
| 173459 | 173515 | ** Invert a changeset object. |
| 173460 | 173516 | */ |
| 173461 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert( | |
| 173517 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_invert( | |
| 173462 | 173518 | int nChangeset, /* Number of bytes in input */ |
| 173463 | 173519 | const void *pChangeset, /* Input changeset */ |
| 173464 | 173520 | int *pnInverted, /* OUT: Number of bytes in output changeset */ |
| 173465 | 173521 | void **ppInverted /* OUT: Inverse of pChangeset */ |
| 173466 | 173522 | ){ |
| @@ -173475,11 +173531,11 @@ | ||
| 173475 | 173531 | } |
| 173476 | 173532 | |
| 173477 | 173533 | /* |
| 173478 | 173534 | ** Streaming version of sqlite3changeset_invert(). |
| 173479 | 173535 | */ |
| 173480 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm( | |
| 173536 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm( | |
| 173481 | 173537 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 173482 | 173538 | void *pIn, |
| 173483 | 173539 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 173484 | 173540 | void *pOut |
| 173485 | 173541 | ){ |
| @@ -174355,11 +174411,11 @@ | ||
| 174355 | 174411 | /* |
| 174356 | 174412 | ** Apply the changeset passed via pChangeset/nChangeset to the main database |
| 174357 | 174413 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 174358 | 174414 | ** to resolve any conflicts encountered while applying the change. |
| 174359 | 174415 | */ |
| 174360 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply( | |
| 174416 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_apply( | |
| 174361 | 174417 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 174362 | 174418 | int nChangeset, /* Size of changeset in bytes */ |
| 174363 | 174419 | void *pChangeset, /* Changeset blob */ |
| 174364 | 174420 | int(*xFilter)( |
| 174365 | 174421 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| @@ -174383,11 +174439,11 @@ | ||
| 174383 | 174439 | /* |
| 174384 | 174440 | ** Apply the changeset passed via xInput/pIn to the main database |
| 174385 | 174441 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 174386 | 174442 | ** to resolve any conflicts encountered while applying the change. |
| 174387 | 174443 | */ |
| 174388 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm( | |
| 174444 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm( | |
| 174389 | 174445 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 174390 | 174446 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 174391 | 174447 | void *pIn, /* First arg for xInput */ |
| 174392 | 174448 | int(*xFilter)( |
| 174393 | 174449 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| @@ -174718,11 +174774,11 @@ | ||
| 174718 | 174774 | } |
| 174719 | 174775 | |
| 174720 | 174776 | /* |
| 174721 | 174777 | ** Allocate a new, empty, sqlite3_changegroup. |
| 174722 | 174778 | */ |
| 174723 | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){ | |
| 174779 | +SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){ | |
| 174724 | 174780 | int rc = SQLITE_OK; /* Return code */ |
| 174725 | 174781 | sqlite3_changegroup *p; /* New object */ |
| 174726 | 174782 | p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup)); |
| 174727 | 174783 | if( p==0 ){ |
| 174728 | 174784 | rc = SQLITE_NOMEM; |
| @@ -174735,11 +174791,11 @@ | ||
| 174735 | 174791 | |
| 174736 | 174792 | /* |
| 174737 | 174793 | ** Add the changeset currently stored in buffer pData, size nData bytes, |
| 174738 | 174794 | ** to changeset-group p. |
| 174739 | 174795 | */ |
| 174740 | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){ | |
| 174796 | +SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){ | |
| 174741 | 174797 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| 174742 | 174798 | int rc; /* Return code */ |
| 174743 | 174799 | |
| 174744 | 174800 | rc = sqlite3changeset_start(&pIter, nData, pData); |
| 174745 | 174801 | if( rc==SQLITE_OK ){ |
| @@ -174751,11 +174807,11 @@ | ||
| 174751 | 174807 | |
| 174752 | 174808 | /* |
| 174753 | 174809 | ** Obtain a buffer containing a changeset representing the concatenation |
| 174754 | 174810 | ** of all changesets added to the group so far. |
| 174755 | 174811 | */ |
| 174756 | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output( | |
| 174812 | +SQLITE_API int SQLITE_APICALL sqlite3changegroup_output( | |
| 174757 | 174813 | sqlite3_changegroup *pGrp, |
| 174758 | 174814 | int *pnData, |
| 174759 | 174815 | void **ppData |
| 174760 | 174816 | ){ |
| 174761 | 174817 | return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData); |
| @@ -174762,11 +174818,11 @@ | ||
| 174762 | 174818 | } |
| 174763 | 174819 | |
| 174764 | 174820 | /* |
| 174765 | 174821 | ** Streaming versions of changegroup_add(). |
| 174766 | 174822 | */ |
| 174767 | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm( | |
| 174823 | +SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm( | |
| 174768 | 174824 | sqlite3_changegroup *pGrp, |
| 174769 | 174825 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 174770 | 174826 | void *pIn |
| 174771 | 174827 | ){ |
| 174772 | 174828 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| @@ -174781,11 +174837,11 @@ | ||
| 174781 | 174837 | } |
| 174782 | 174838 | |
| 174783 | 174839 | /* |
| 174784 | 174840 | ** Streaming versions of changegroup_output(). |
| 174785 | 174841 | */ |
| 174786 | -SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm( | |
| 174842 | +SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm( | |
| 174787 | 174843 | sqlite3_changegroup *pGrp, |
| 174788 | 174844 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 174789 | 174845 | void *pOut |
| 174790 | 174846 | ){ |
| 174791 | 174847 | return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0); |
| @@ -174792,21 +174848,21 @@ | ||
| 174792 | 174848 | } |
| 174793 | 174849 | |
| 174794 | 174850 | /* |
| 174795 | 174851 | ** Delete a changegroup object. |
| 174796 | 174852 | */ |
| 174797 | -SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ | |
| 174853 | +SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ | |
| 174798 | 174854 | if( pGrp ){ |
| 174799 | 174855 | sessionDeleteTable(pGrp->pList); |
| 174800 | 174856 | sqlite3_free(pGrp); |
| 174801 | 174857 | } |
| 174802 | 174858 | } |
| 174803 | 174859 | |
| 174804 | 174860 | /* |
| 174805 | 174861 | ** Combine two changesets together. |
| 174806 | 174862 | */ |
| 174807 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat( | |
| 174863 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_concat( | |
| 174808 | 174864 | int nLeft, /* Number of bytes in lhs input */ |
| 174809 | 174865 | void *pLeft, /* Lhs input changeset */ |
| 174810 | 174866 | int nRight /* Number of bytes in rhs input */, |
| 174811 | 174867 | void *pRight, /* Rhs input changeset */ |
| 174812 | 174868 | int *pnOut, /* OUT: Number of bytes in output changeset */ |
| @@ -174831,11 +174887,11 @@ | ||
| 174831 | 174887 | } |
| 174832 | 174888 | |
| 174833 | 174889 | /* |
| 174834 | 174890 | ** Streaming version of sqlite3changeset_concat(). |
| 174835 | 174891 | */ |
| 174836 | -SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm( | |
| 174892 | +SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm( | |
| 174837 | 174893 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 174838 | 174894 | void *pInA, |
| 174839 | 174895 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| 174840 | 174896 | void *pInB, |
| 174841 | 174897 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| @@ -177062,11 +177118,11 @@ | ||
| 177062 | 177118 | |
| 177063 | 177119 | #ifndef SQLITE_CORE |
| 177064 | 177120 | #ifdef _WIN32 |
| 177065 | 177121 | __declspec(dllexport) |
| 177066 | 177122 | #endif |
| 177067 | -SQLITE_API int SQLITE_STDCALL sqlite3_json_init( | |
| 177123 | +SQLITE_API int SQLITE_APICALL sqlite3_json_init( | |
| 177068 | 177124 | sqlite3 *db, |
| 177069 | 177125 | char **pzErrMsg, |
| 177070 | 177126 | const sqlite3_api_routines *pApi |
| 177071 | 177127 | ){ |
| 177072 | 177128 | SQLITE_EXTENSION_INIT2(pApi); |
| @@ -193895,11 +193951,11 @@ | ||
| 193895 | 193951 | int nArg, /* Number of args */ |
| 193896 | 193952 | sqlite3_value **apUnused /* Function arguments */ |
| 193897 | 193953 | ){ |
| 193898 | 193954 | assert( nArg==0 ); |
| 193899 | 193955 | UNUSED_PARAM2(nArg, apUnused); |
| 193900 | - sqlite3_result_text(pCtx, "fts5: 2016-07-26 10:46:21 483994a54dee3c7a3801e0e9d3c96fa9dbd8d2fd", -1, SQLITE_TRANSIENT); | |
| 193956 | + sqlite3_result_text(pCtx, "fts5: 2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914", -1, SQLITE_TRANSIENT); | |
| 193901 | 193957 | } |
| 193902 | 193958 | |
| 193903 | 193959 | static int fts5Init(sqlite3 *db){ |
| 193904 | 193960 | static const sqlite3_module fts5Mod = { |
| 193905 | 193961 | /* iVersion */ 2, |
| @@ -193983,11 +194039,11 @@ | ||
| 193983 | 194039 | */ |
| 193984 | 194040 | #ifndef SQLITE_CORE |
| 193985 | 194041 | #ifdef _WIN32 |
| 193986 | 194042 | __declspec(dllexport) |
| 193987 | 194043 | #endif |
| 193988 | -SQLITE_API int SQLITE_STDCALL sqlite3_fts_init( | |
| 194044 | +SQLITE_API int SQLITE_APICALL sqlite3_fts_init( | |
| 193989 | 194045 | sqlite3 *db, |
| 193990 | 194046 | char **pzErrMsg, |
| 193991 | 194047 | const sqlite3_api_routines *pApi |
| 193992 | 194048 | ){ |
| 193993 | 194049 | SQLITE_EXTENSION_INIT2(pApi); |
| @@ -193996,11 +194052,11 @@ | ||
| 193996 | 194052 | } |
| 193997 | 194053 | |
| 193998 | 194054 | #ifdef _WIN32 |
| 193999 | 194055 | __declspec(dllexport) |
| 194000 | 194056 | #endif |
| 194001 | -SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init( | |
| 194057 | +SQLITE_API int SQLITE_APICALL sqlite3_fts5_init( | |
| 194002 | 194058 | sqlite3 *db, |
| 194003 | 194059 | char **pzErrMsg, |
| 194004 | 194060 | const sqlite3_api_routines *pApi |
| 194005 | 194061 | ){ |
| 194006 | 194062 | SQLITE_EXTENSION_INIT2(pApi); |
| 194007 | 194063 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -65,10 +65,18 @@ | |
| 65 | ** In all cases, the special comment must be enclosed in the usual |
| 66 | ** slash-asterisk...asterisk-slash comment marks, with no spaces between the |
| 67 | ** asterisks and the comment text. |
| 68 | */ |
| 69 | |
| 70 | /* |
| 71 | ** Make sure that rand_s() is available on Windows systems with MSVC 2005 |
| 72 | ** or higher. |
| 73 | */ |
| 74 | #if defined(_MSC_VER) && _MSC_VER>=1400 |
| @@ -304,12 +312,21 @@ | |
| 304 | # define SQLITE_API |
| 305 | #endif |
| 306 | #ifndef SQLITE_CDECL |
| 307 | # define SQLITE_CDECL |
| 308 | #endif |
| 309 | #ifndef SQLITE_STDCALL |
| 310 | # define SQLITE_STDCALL |
| 311 | #endif |
| 312 | |
| 313 | /* |
| 314 | ** These no-op macros are used in front of interfaces to mark those |
| 315 | ** interfaces as either deprecated or experimental. New applications |
| @@ -363,11 +380,11 @@ | |
| 363 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 364 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 365 | */ |
| 366 | #define SQLITE_VERSION "3.14.0" |
| 367 | #define SQLITE_VERSION_NUMBER 3014000 |
| 368 | #define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586" |
| 369 | |
| 370 | /* |
| 371 | ** CAPI3REF: Run-Time Library Version Numbers |
| 372 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 373 | ** |
| @@ -396,13 +413,13 @@ | |
| 396 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 397 | ** |
| 398 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 399 | */ |
| 400 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 401 | SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void); |
| 402 | SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void); |
| 403 | SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void); |
| 404 | |
| 405 | /* |
| 406 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 407 | ** |
| 408 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| @@ -423,12 +440,12 @@ | |
| 423 | ** |
| 424 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 425 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 426 | */ |
| 427 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 428 | SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName); |
| 429 | SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N); |
| 430 | #endif |
| 431 | |
| 432 | /* |
| 433 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 434 | ** |
| @@ -463,11 +480,11 @@ | |
| 463 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 464 | ** is unchanged by calls to sqlite3_config().)^ |
| 465 | ** |
| 466 | ** See the [threading mode] documentation for additional information. |
| 467 | */ |
| 468 | SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void); |
| 469 | |
| 470 | /* |
| 471 | ** CAPI3REF: Database Connection Handle |
| 472 | ** KEYWORDS: {database connection} {database connections} |
| 473 | ** |
| @@ -560,19 +577,19 @@ | |
| 560 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 561 | ** [sqlite3_open_v2()], and not previously closed. |
| 562 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 563 | ** argument is a harmless no-op. |
| 564 | */ |
| 565 | SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*); |
| 566 | SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*); |
| 567 | |
| 568 | /* |
| 569 | ** The type for a callback function. |
| 570 | ** This is legacy and deprecated. It is included for historical |
| 571 | ** compatibility and is not documented. |
| 572 | */ |
| 573 | typedef int (*sqlite3_callback)(void*,int,char**, char**); |
| 574 | |
| 575 | /* |
| 576 | ** CAPI3REF: One-Step Query Execution Interface |
| 577 | ** METHOD: sqlite3 |
| 578 | ** |
| @@ -632,14 +649,14 @@ | |
| 632 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 633 | ** <li> The application must not modify the SQL statement text passed into |
| 634 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 635 | ** </ul> |
| 636 | */ |
| 637 | SQLITE_API int SQLITE_STDCALL sqlite3_exec( |
| 638 | sqlite3*, /* An open database */ |
| 639 | const char *sql, /* SQL to be evaluated */ |
| 640 | int (*callback)(void*,int,char**,char**), /* Callback function */ |
| 641 | void *, /* 1st argument to callback */ |
| 642 | char **errmsg /* Error msg written here */ |
| 643 | ); |
| 644 | |
| 645 | /* |
| @@ -983,30 +1000,30 @@ | |
| 983 | ** database corruption. |
| 984 | */ |
| 985 | typedef struct sqlite3_io_methods sqlite3_io_methods; |
| 986 | struct sqlite3_io_methods { |
| 987 | int iVersion; |
| 988 | int (*xClose)(sqlite3_file*); |
| 989 | int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); |
| 990 | int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); |
| 991 | int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); |
| 992 | int (*xSync)(sqlite3_file*, int flags); |
| 993 | int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); |
| 994 | int (*xLock)(sqlite3_file*, int); |
| 995 | int (*xUnlock)(sqlite3_file*, int); |
| 996 | int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); |
| 997 | int (*xFileControl)(sqlite3_file*, int op, void *pArg); |
| 998 | int (*xSectorSize)(sqlite3_file*); |
| 999 | int (*xDeviceCharacteristics)(sqlite3_file*); |
| 1000 | /* Methods above are valid for version 1 */ |
| 1001 | int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); |
| 1002 | int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); |
| 1003 | void (*xShmBarrier)(sqlite3_file*); |
| 1004 | int (*xShmUnmap)(sqlite3_file*, int deleteFlag); |
| 1005 | /* Methods above are valid for version 2 */ |
| 1006 | int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); |
| 1007 | int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); |
| 1008 | /* Methods above are valid for version 3 */ |
| 1009 | /* Additional methods may be added in future releases */ |
| 1010 | }; |
| 1011 | |
| 1012 | /* |
| @@ -1178,11 +1195,11 @@ | |
| 1178 | ** ^The [SQLITE_FCNTL_BUSYHANDLER] |
| 1179 | ** file-control may be invoked by SQLite on the database file handle |
| 1180 | ** shortly after it is opened in order to provide a custom VFS with access |
| 1181 | ** to the connections busy-handler callback. The argument is of type (void **) |
| 1182 | ** - an array of two (void *) values. The first (void *) actually points |
| 1183 | ** to a function of type (int (*)(void *)). In order to invoke the connections |
| 1184 | ** busy-handler, this function should be invoked with the second (void *) in |
| 1185 | ** the array as the only argument. If it returns non-zero, then the operation |
| 1186 | ** should be retried. If it returns zero, the custom VFS should abandon the |
| 1187 | ** current operation. |
| 1188 | ** |
| @@ -1444,43 +1461,43 @@ | |
| 1444 | ** or all of these interfaces to be NULL or for their behavior to change |
| 1445 | ** from one release to the next. Applications must not attempt to access |
| 1446 | ** any of these methods if the iVersion of the VFS is less than 3. |
| 1447 | */ |
| 1448 | typedef struct sqlite3_vfs sqlite3_vfs; |
| 1449 | typedef void (*sqlite3_syscall_ptr)(void); |
| 1450 | struct sqlite3_vfs { |
| 1451 | int iVersion; /* Structure version number (currently 3) */ |
| 1452 | int szOsFile; /* Size of subclassed sqlite3_file */ |
| 1453 | int mxPathname; /* Maximum file pathname length */ |
| 1454 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1455 | const char *zName; /* Name of this virtual file system */ |
| 1456 | void *pAppData; /* Pointer to application-specific data */ |
| 1457 | int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, |
| 1458 | int flags, int *pOutFlags); |
| 1459 | int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); |
| 1460 | int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); |
| 1461 | int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); |
| 1462 | void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); |
| 1463 | void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); |
| 1464 | void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); |
| 1465 | void (*xDlClose)(sqlite3_vfs*, void*); |
| 1466 | int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); |
| 1467 | int (*xSleep)(sqlite3_vfs*, int microseconds); |
| 1468 | int (*xCurrentTime)(sqlite3_vfs*, double*); |
| 1469 | int (*xGetLastError)(sqlite3_vfs*, int, char *); |
| 1470 | /* |
| 1471 | ** The methods above are in version 1 of the sqlite_vfs object |
| 1472 | ** definition. Those that follow are added in version 2 or later |
| 1473 | */ |
| 1474 | int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); |
| 1475 | /* |
| 1476 | ** The methods above are in versions 1 and 2 of the sqlite_vfs object. |
| 1477 | ** Those below are for version 3 and greater. |
| 1478 | */ |
| 1479 | int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); |
| 1480 | sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); |
| 1481 | const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); |
| 1482 | /* |
| 1483 | ** The methods above are in versions 1 through 3 of the sqlite_vfs object. |
| 1484 | ** New fields may be appended in future versions. The iVersion |
| 1485 | ** value will increment whenever this happens. |
| 1486 | */ |
| @@ -1621,14 +1638,14 @@ | |
| 1621 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1622 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1623 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1624 | ** failure. |
| 1625 | */ |
| 1626 | SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); |
| 1627 | SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); |
| 1628 | SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); |
| 1629 | SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void); |
| 1630 | |
| 1631 | /* |
| 1632 | ** CAPI3REF: Configuring The SQLite Library |
| 1633 | ** |
| 1634 | ** The sqlite3_config() interface is used to make global configuration |
| @@ -1743,17 +1760,17 @@ | |
| 1743 | ** SQLite will never invoke xInit() more than once without an intervening |
| 1744 | ** call to xShutdown(). |
| 1745 | */ |
| 1746 | typedef struct sqlite3_mem_methods sqlite3_mem_methods; |
| 1747 | struct sqlite3_mem_methods { |
| 1748 | void *(*xMalloc)(int); /* Memory allocation function */ |
| 1749 | void (*xFree)(void*); /* Free a prior allocation */ |
| 1750 | void *(*xRealloc)(void*,int); /* Resize an allocation */ |
| 1751 | int (*xSize)(void*); /* Return the size of an allocation */ |
| 1752 | int (*xRoundup)(int); /* Round up request size to allocation size */ |
| 1753 | int (*xInit)(void*); /* Initialize the memory allocator */ |
| 1754 | void (*xShutdown)(void*); /* Deinitialize the memory allocator */ |
| 1755 | void *pAppData; /* Argument to xInit() and xShutdown() */ |
| 1756 | }; |
| 1757 | |
| 1758 | /* |
| 1759 | ** CAPI3REF: Configuration Options |
| @@ -1966,11 +1983,11 @@ | |
| 1966 | ** |
| 1967 | ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt> |
| 1968 | ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite |
| 1969 | ** global [error log]. |
| 1970 | ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a |
| 1971 | ** function with a call signature of void(*)(void*,int,const char*), |
| 1972 | ** and a pointer to void. ^If the function pointer is not NULL, it is |
| 1973 | ** invoked by [sqlite3_log()] to process each logging event. ^If the |
| 1974 | ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. |
| 1975 | ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is |
| 1976 | ** passed through as the first parameter to the application-defined logger |
| @@ -2019,11 +2036,11 @@ | |
| 2019 | ** |
| 2020 | ** [[SQLITE_CONFIG_SQLLOG]] |
| 2021 | ** <dt>SQLITE_CONFIG_SQLLOG |
| 2022 | ** <dd>This option is only available if sqlite is compiled with the |
| 2023 | ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should |
| 2024 | ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). |
| 2025 | ** The second should be of type (void*). The callback is invoked by the library |
| 2026 | ** in three separate circumstances, identified by the value passed as the |
| 2027 | ** fourth parameter. If the fourth parameter is 0, then the database connection |
| 2028 | ** passed as the second argument has just been opened. The third argument |
| 2029 | ** points to a buffer containing the name of the main database file. If the |
| @@ -2217,11 +2234,11 @@ | |
| 2217 | ** |
| 2218 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 2219 | ** [extended result codes] feature of SQLite. ^The extended result |
| 2220 | ** codes are disabled by default for historical compatibility. |
| 2221 | */ |
| 2222 | SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff); |
| 2223 | |
| 2224 | /* |
| 2225 | ** CAPI3REF: Last Insert Rowid |
| 2226 | ** METHOD: sqlite3 |
| 2227 | ** |
| @@ -2269,11 +2286,11 @@ | |
| 2269 | ** function is running and thus changes the last insert [rowid], |
| 2270 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2271 | ** unpredictable and might not equal either the old or the new |
| 2272 | ** last insert [rowid]. |
| 2273 | */ |
| 2274 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*); |
| 2275 | |
| 2276 | /* |
| 2277 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2278 | ** METHOD: sqlite3 |
| 2279 | ** |
| @@ -2322,11 +2339,11 @@ | |
| 2322 | ** |
| 2323 | ** If a separate thread makes changes on the same database connection |
| 2324 | ** while [sqlite3_changes()] is running then the value returned |
| 2325 | ** is unpredictable and not meaningful. |
| 2326 | */ |
| 2327 | SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*); |
| 2328 | |
| 2329 | /* |
| 2330 | ** CAPI3REF: Total Number Of Rows Modified |
| 2331 | ** METHOD: sqlite3 |
| 2332 | ** |
| @@ -2346,11 +2363,11 @@ | |
| 2346 | ** |
| 2347 | ** If a separate thread makes changes on the same database connection |
| 2348 | ** while [sqlite3_total_changes()] is running then the value |
| 2349 | ** returned is unpredictable and not meaningful. |
| 2350 | */ |
| 2351 | SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*); |
| 2352 | |
| 2353 | /* |
| 2354 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2355 | ** METHOD: sqlite3 |
| 2356 | ** |
| @@ -2386,11 +2403,11 @@ | |
| 2386 | ** that are started after the sqlite3_interrupt() call returns. |
| 2387 | ** |
| 2388 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2389 | ** is running then bad things will likely happen. |
| 2390 | */ |
| 2391 | SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*); |
| 2392 | |
| 2393 | /* |
| 2394 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2395 | ** |
| 2396 | ** These routines are useful during command-line input to determine if the |
| @@ -2421,12 +2438,12 @@ | |
| 2421 | ** UTF-8 string. |
| 2422 | ** |
| 2423 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2424 | ** UTF-16 string in native byte order. |
| 2425 | */ |
| 2426 | SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql); |
| 2427 | SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql); |
| 2428 | |
| 2429 | /* |
| 2430 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2431 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2432 | ** METHOD: sqlite3 |
| @@ -2483,11 +2500,11 @@ | |
| 2483 | ** result in undefined behavior. |
| 2484 | ** |
| 2485 | ** A busy handler must not close the database connection |
| 2486 | ** or [prepared statement] that invoked the busy handler. |
| 2487 | */ |
| 2488 | SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); |
| 2489 | |
| 2490 | /* |
| 2491 | ** CAPI3REF: Set A Busy Timeout |
| 2492 | ** METHOD: sqlite3 |
| 2493 | ** |
| @@ -2506,11 +2523,11 @@ | |
| 2506 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2507 | ** this routine, that other busy handler is cleared.)^ |
| 2508 | ** |
| 2509 | ** See also: [PRAGMA busy_timeout] |
| 2510 | */ |
| 2511 | SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms); |
| 2512 | |
| 2513 | /* |
| 2514 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2515 | ** METHOD: sqlite3 |
| 2516 | ** |
| @@ -2581,19 +2598,19 @@ | |
| 2581 | ** interface defined here. As a consequence, errors that occur in the |
| 2582 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2583 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2584 | ** [sqlite3_errmsg()]. |
| 2585 | */ |
| 2586 | SQLITE_API int SQLITE_STDCALL sqlite3_get_table( |
| 2587 | sqlite3 *db, /* An open database */ |
| 2588 | const char *zSql, /* SQL to be evaluated */ |
| 2589 | char ***pazResult, /* Results of the query */ |
| 2590 | int *pnRow, /* Number of result rows written here */ |
| 2591 | int *pnColumn, /* Number of result columns written here */ |
| 2592 | char **pzErrmsg /* Error msg written here */ |
| 2593 | ); |
| 2594 | SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result); |
| 2595 | |
| 2596 | /* |
| 2597 | ** CAPI3REF: Formatted String Printing Functions |
| 2598 | ** |
| 2599 | ** These routines are work-alikes of the "printf()" family of functions |
| @@ -2696,13 +2713,13 @@ | |
| 2696 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2697 | ** addition that after the string has been read and copied into |
| 2698 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2699 | */ |
| 2700 | SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2701 | SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); |
| 2702 | SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2703 | SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list); |
| 2704 | |
| 2705 | /* |
| 2706 | ** CAPI3REF: Memory Allocation Subsystem |
| 2707 | ** |
| 2708 | ** The SQLite core uses these three routines for all of its own |
| @@ -2788,16 +2805,16 @@ | |
| 2788 | ** |
| 2789 | ** The application must not read or write any part of |
| 2790 | ** a block of memory after it has been released using |
| 2791 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2792 | */ |
| 2793 | SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int); |
| 2794 | SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64); |
| 2795 | SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int); |
| 2796 | SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64); |
| 2797 | SQLITE_API void SQLITE_STDCALL sqlite3_free(void*); |
| 2798 | SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*); |
| 2799 | |
| 2800 | /* |
| 2801 | ** CAPI3REF: Memory Allocator Statistics |
| 2802 | ** |
| 2803 | ** SQLite provides these two interfaces for reporting on the status |
| @@ -2818,12 +2835,12 @@ | |
| 2818 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2819 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2820 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2821 | ** prior to the reset. |
| 2822 | */ |
| 2823 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void); |
| 2824 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag); |
| 2825 | |
| 2826 | /* |
| 2827 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2828 | ** |
| 2829 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| @@ -2842,11 +2859,11 @@ | |
| 2842 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2843 | ** non-NULL P then the pseudo-randomness is generated |
| 2844 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2845 | ** method. |
| 2846 | */ |
| 2847 | SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P); |
| 2848 | |
| 2849 | /* |
| 2850 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2851 | ** METHOD: sqlite3 |
| 2852 | ** |
| @@ -2925,13 +2942,13 @@ | |
| 2925 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2926 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2927 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2928 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2929 | */ |
| 2930 | SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( |
| 2931 | sqlite3*, |
| 2932 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 2933 | void *pUserData |
| 2934 | ); |
| 2935 | |
| 2936 | /* |
| 2937 | ** CAPI3REF: Authorizer Return Codes |
| @@ -3033,14 +3050,14 @@ | |
| 3033 | ** digits in the time are meaningless. Future versions of SQLite |
| 3034 | ** might provide greater resolution on the profiler callback. The |
| 3035 | ** sqlite3_profile() function is considered experimental and is |
| 3036 | ** subject to change in future versions of SQLite. |
| 3037 | */ |
| 3038 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*, |
| 3039 | void(*xTrace)(void*,const char*), void*); |
| 3040 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*, |
| 3041 | void(*xProfile)(void*,const char*,sqlite3_uint64), void*); |
| 3042 | |
| 3043 | /* |
| 3044 | ** CAPI3REF: SQL Trace Event Codes |
| 3045 | ** KEYWORDS: SQLITE_TRACE |
| 3046 | ** |
| @@ -3124,14 +3141,14 @@ | |
| 3124 | ** |
| 3125 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 3126 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 3127 | ** are deprecated. |
| 3128 | */ |
| 3129 | SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( |
| 3130 | sqlite3*, |
| 3131 | unsigned uMask, |
| 3132 | int(*xCallback)(unsigned,void*,void*,void*), |
| 3133 | void *pCtx |
| 3134 | ); |
| 3135 | |
| 3136 | /* |
| 3137 | ** CAPI3REF: Query Progress Callbacks |
| @@ -3163,11 +3180,11 @@ | |
| 3163 | ** the database connection that invoked the progress handler. |
| 3164 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 3165 | ** database connections for the meaning of "modify" in this paragraph. |
| 3166 | ** |
| 3167 | */ |
| 3168 | SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); |
| 3169 | |
| 3170 | /* |
| 3171 | ** CAPI3REF: Opening A New Database Connection |
| 3172 | ** CONSTRUCTOR: sqlite3 |
| 3173 | ** |
| @@ -3392,19 +3409,19 @@ | |
| 3392 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3393 | ** features that require the use of temporary files may fail. |
| 3394 | ** |
| 3395 | ** See also: [sqlite3_temp_directory] |
| 3396 | */ |
| 3397 | SQLITE_API int SQLITE_STDCALL sqlite3_open( |
| 3398 | const char *filename, /* Database filename (UTF-8) */ |
| 3399 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3400 | ); |
| 3401 | SQLITE_API int SQLITE_STDCALL sqlite3_open16( |
| 3402 | const void *filename, /* Database filename (UTF-16) */ |
| 3403 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3404 | ); |
| 3405 | SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( |
| 3406 | const char *filename, /* Database filename (UTF-8) */ |
| 3407 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3408 | int flags, /* Flags */ |
| 3409 | const char *zVfs /* Name of VFS module to use */ |
| 3410 | ); |
| @@ -3446,13 +3463,13 @@ | |
| 3446 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3447 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3448 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3449 | ** undesirable. |
| 3450 | */ |
| 3451 | SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); |
| 3452 | SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); |
| 3453 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); |
| 3454 | |
| 3455 | |
| 3456 | /* |
| 3457 | ** CAPI3REF: Error Codes And Messages |
| 3458 | ** METHOD: sqlite3 |
| @@ -3492,15 +3509,15 @@ | |
| 3492 | ** |
| 3493 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3494 | ** was invoked incorrectly by the application. In that case, the |
| 3495 | ** error code and message may or may not be set. |
| 3496 | */ |
| 3497 | SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); |
| 3498 | SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); |
| 3499 | SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); |
| 3500 | SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); |
| 3501 | SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int); |
| 3502 | |
| 3503 | /* |
| 3504 | ** CAPI3REF: Prepared Statement Object |
| 3505 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3506 | ** |
| @@ -3564,11 +3581,11 @@ | |
| 3564 | ** created by an untrusted script can be contained using the |
| 3565 | ** [max_page_count] [PRAGMA]. |
| 3566 | ** |
| 3567 | ** New run-time limit categories may be added in future releases. |
| 3568 | */ |
| 3569 | SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal); |
| 3570 | |
| 3571 | /* |
| 3572 | ** CAPI3REF: Run-Time Limit Categories |
| 3573 | ** KEYWORDS: {limit category} {*limit categories} |
| 3574 | ** |
| @@ -3716,32 +3733,32 @@ | |
| 3716 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3717 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3718 | ** </li> |
| 3719 | ** </ol> |
| 3720 | */ |
| 3721 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare( |
| 3722 | sqlite3 *db, /* Database handle */ |
| 3723 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3724 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3725 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3726 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3727 | ); |
| 3728 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( |
| 3729 | sqlite3 *db, /* Database handle */ |
| 3730 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3731 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3732 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3733 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3734 | ); |
| 3735 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( |
| 3736 | sqlite3 *db, /* Database handle */ |
| 3737 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3738 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3739 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3740 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3741 | ); |
| 3742 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( |
| 3743 | sqlite3 *db, /* Database handle */ |
| 3744 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3745 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3746 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3747 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| @@ -3776,12 +3793,12 @@ | |
| 3776 | ** automatically freed when the prepared statement is finalized. |
| 3777 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3778 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3779 | ** by passing it to [sqlite3_free()]. |
| 3780 | */ |
| 3781 | SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt); |
| 3782 | SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); |
| 3783 | |
| 3784 | /* |
| 3785 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3786 | ** METHOD: sqlite3_stmt |
| 3787 | ** |
| @@ -3809,11 +3826,11 @@ | |
| 3809 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3810 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3811 | ** change the configuration of a database connection, they do not make |
| 3812 | ** changes to the content of the database files on disk. |
| 3813 | */ |
| 3814 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 3815 | |
| 3816 | /* |
| 3817 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3818 | ** METHOD: sqlite3_stmt |
| 3819 | ** |
| @@ -3830,11 +3847,11 @@ | |
| 3830 | ** to locate all prepared statements associated with a database |
| 3831 | ** connection that are in need of being reset. This can be used, |
| 3832 | ** for example, in diagnostic routines to search for prepared |
| 3833 | ** statements that are holding a transaction open. |
| 3834 | */ |
| 3835 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*); |
| 3836 | |
| 3837 | /* |
| 3838 | ** CAPI3REF: Dynamically Typed Value Object |
| 3839 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3840 | ** |
| @@ -3994,24 +4011,24 @@ | |
| 3994 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 3995 | ** |
| 3996 | ** See also: [sqlite3_bind_parameter_count()], |
| 3997 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 3998 | */ |
| 3999 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); |
| 4000 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, |
| 4001 | void(*)(void*)); |
| 4002 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double); |
| 4003 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int); |
| 4004 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); |
| 4005 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int); |
| 4006 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); |
| 4007 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 4008 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 4009 | void(*)(void*), unsigned char encoding); |
| 4010 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 4011 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 4012 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); |
| 4013 | |
| 4014 | /* |
| 4015 | ** CAPI3REF: Number Of SQL Parameters |
| 4016 | ** METHOD: sqlite3_stmt |
| 4017 | ** |
| @@ -4028,11 +4045,11 @@ | |
| 4028 | ** |
| 4029 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4030 | ** [sqlite3_bind_parameter_name()], and |
| 4031 | ** [sqlite3_bind_parameter_index()]. |
| 4032 | */ |
| 4033 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*); |
| 4034 | |
| 4035 | /* |
| 4036 | ** CAPI3REF: Name Of A Host Parameter |
| 4037 | ** METHOD: sqlite3_stmt |
| 4038 | ** |
| @@ -4056,11 +4073,11 @@ | |
| 4056 | ** |
| 4057 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4058 | ** [sqlite3_bind_parameter_count()], and |
| 4059 | ** [sqlite3_bind_parameter_index()]. |
| 4060 | */ |
| 4061 | SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); |
| 4062 | |
| 4063 | /* |
| 4064 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 4065 | ** METHOD: sqlite3_stmt |
| 4066 | ** |
| @@ -4073,21 +4090,21 @@ | |
| 4073 | ** |
| 4074 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4075 | ** [sqlite3_bind_parameter_count()], and |
| 4076 | ** [sqlite3_bind_parameter_name()]. |
| 4077 | */ |
| 4078 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); |
| 4079 | |
| 4080 | /* |
| 4081 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 4082 | ** METHOD: sqlite3_stmt |
| 4083 | ** |
| 4084 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 4085 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 4086 | ** ^Use this routine to reset all host parameters to NULL. |
| 4087 | */ |
| 4088 | SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*); |
| 4089 | |
| 4090 | /* |
| 4091 | ** CAPI3REF: Number Of Columns In A Result Set |
| 4092 | ** METHOD: sqlite3_stmt |
| 4093 | ** |
| @@ -4095,11 +4112,11 @@ | |
| 4095 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 4096 | ** statement that does not return data (for example an [UPDATE]). |
| 4097 | ** |
| 4098 | ** See also: [sqlite3_data_count()] |
| 4099 | */ |
| 4100 | SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt); |
| 4101 | |
| 4102 | /* |
| 4103 | ** CAPI3REF: Column Names In A Result Set |
| 4104 | ** METHOD: sqlite3_stmt |
| 4105 | ** |
| @@ -4124,12 +4141,12 @@ | |
| 4124 | ** ^The name of a result column is the value of the "AS" clause for |
| 4125 | ** that column, if there is an AS clause. If there is no AS clause |
| 4126 | ** then the name of the column is unspecified and may change from |
| 4127 | ** one release of SQLite to the next. |
| 4128 | */ |
| 4129 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N); |
| 4130 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N); |
| 4131 | |
| 4132 | /* |
| 4133 | ** CAPI3REF: Source Of Data In A Query Result |
| 4134 | ** METHOD: sqlite3_stmt |
| 4135 | ** |
| @@ -4173,16 +4190,16 @@ | |
| 4173 | ** If two or more threads call one or more |
| 4174 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 4175 | ** for the same [prepared statement] and result column |
| 4176 | ** at the same time then the results are undefined. |
| 4177 | */ |
| 4178 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); |
| 4179 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); |
| 4180 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); |
| 4181 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); |
| 4182 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); |
| 4183 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int); |
| 4184 | |
| 4185 | /* |
| 4186 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 4187 | ** METHOD: sqlite3_stmt |
| 4188 | ** |
| @@ -4210,12 +4227,12 @@ | |
| 4210 | ** data stored in that column is of the declared type. SQLite is |
| 4211 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 4212 | ** is associated with individual values, not with the containers |
| 4213 | ** used to hold those values. |
| 4214 | */ |
| 4215 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int); |
| 4216 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int); |
| 4217 | |
| 4218 | /* |
| 4219 | ** CAPI3REF: Evaluate An SQL Statement |
| 4220 | ** METHOD: sqlite3_stmt |
| 4221 | ** |
| @@ -4291,11 +4308,11 @@ | |
| 4291 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4292 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4293 | ** then the more specific [error codes] are returned directly |
| 4294 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4295 | */ |
| 4296 | SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*); |
| 4297 | |
| 4298 | /* |
| 4299 | ** CAPI3REF: Number of columns in a result set |
| 4300 | ** METHOD: sqlite3_stmt |
| 4301 | ** |
| @@ -4312,11 +4329,11 @@ | |
| 4312 | ** where it always returns zero since each step of that multi-step |
| 4313 | ** pragma returns 0 columns of data. |
| 4314 | ** |
| 4315 | ** See also: [sqlite3_column_count()] |
| 4316 | */ |
| 4317 | SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt); |
| 4318 | |
| 4319 | /* |
| 4320 | ** CAPI3REF: Fundamental Datatypes |
| 4321 | ** KEYWORDS: SQLITE_TEXT |
| 4322 | ** |
| @@ -4502,20 +4519,20 @@ | |
| 4502 | ** of these routines, a default value is returned. The default value |
| 4503 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4504 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4505 | ** [SQLITE_NOMEM].)^ |
| 4506 | */ |
| 4507 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol); |
| 4508 | SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); |
| 4509 | SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); |
| 4510 | SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol); |
| 4511 | SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol); |
| 4512 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol); |
| 4513 | SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol); |
| 4514 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 4515 | SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol); |
| 4516 | SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol); |
| 4517 | |
| 4518 | /* |
| 4519 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4520 | ** DESTRUCTOR: sqlite3_stmt |
| 4521 | ** |
| @@ -4539,11 +4556,11 @@ | |
| 4539 | ** resource leaks. It is a grievous error for the application to try to use |
| 4540 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4541 | ** statement after it has been finalized can result in undefined and |
| 4542 | ** undesirable behavior such as segfaults and heap corruption. |
| 4543 | */ |
| 4544 | SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt); |
| 4545 | |
| 4546 | /* |
| 4547 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4548 | ** METHOD: sqlite3_stmt |
| 4549 | ** |
| @@ -4566,11 +4583,11 @@ | |
| 4566 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4567 | ** |
| 4568 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4569 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4570 | */ |
| 4571 | SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt); |
| 4572 | |
| 4573 | /* |
| 4574 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4575 | ** KEYWORDS: {function creation routines} |
| 4576 | ** KEYWORDS: {application-defined SQL function} |
| @@ -4666,40 +4683,40 @@ | |
| 4666 | ** ^An application-defined function is permitted to call other |
| 4667 | ** SQLite interfaces. However, such calls must not |
| 4668 | ** close the database connection nor finalize or reset the prepared |
| 4669 | ** statement in which the function is running. |
| 4670 | */ |
| 4671 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function( |
| 4672 | sqlite3 *db, |
| 4673 | const char *zFunctionName, |
| 4674 | int nArg, |
| 4675 | int eTextRep, |
| 4676 | void *pApp, |
| 4677 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4678 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4679 | void (*xFinal)(sqlite3_context*) |
| 4680 | ); |
| 4681 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( |
| 4682 | sqlite3 *db, |
| 4683 | const void *zFunctionName, |
| 4684 | int nArg, |
| 4685 | int eTextRep, |
| 4686 | void *pApp, |
| 4687 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4688 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4689 | void (*xFinal)(sqlite3_context*) |
| 4690 | ); |
| 4691 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( |
| 4692 | sqlite3 *db, |
| 4693 | const char *zFunctionName, |
| 4694 | int nArg, |
| 4695 | int eTextRep, |
| 4696 | void *pApp, |
| 4697 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4698 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4699 | void (*xFinal)(sqlite3_context*), |
| 4700 | void(*xDestroy)(void*) |
| 4701 | ); |
| 4702 | |
| 4703 | /* |
| 4704 | ** CAPI3REF: Text Encodings |
| 4705 | ** |
| @@ -4732,16 +4749,16 @@ | |
| 4732 | ** to be supported. However, new applications should avoid |
| 4733 | ** the use of these functions. To encourage programmers to avoid |
| 4734 | ** these functions, we will not explain what they do. |
| 4735 | */ |
| 4736 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4737 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*); |
| 4738 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*); |
| 4739 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); |
| 4740 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void); |
| 4741 | SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void); |
| 4742 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), |
| 4743 | void*,sqlite3_int64); |
| 4744 | #endif |
| 4745 | |
| 4746 | /* |
| 4747 | ** CAPI3REF: Obtaining SQL Values |
| @@ -4787,22 +4804,22 @@ | |
| 4787 | ** or [sqlite3_value_text16()]. |
| 4788 | ** |
| 4789 | ** These routines must be called from the same thread as |
| 4790 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4791 | */ |
| 4792 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*); |
| 4793 | SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*); |
| 4794 | SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*); |
| 4795 | SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*); |
| 4796 | SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*); |
| 4797 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*); |
| 4798 | SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*); |
| 4799 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*); |
| 4800 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*); |
| 4801 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*); |
| 4802 | SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*); |
| 4803 | SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*); |
| 4804 | |
| 4805 | /* |
| 4806 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4807 | ** METHOD: sqlite3_value |
| 4808 | ** |
| @@ -4814,11 +4831,11 @@ | |
| 4814 | ** |
| 4815 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4816 | ** from the result of one [application-defined SQL function] into the |
| 4817 | ** input of another. |
| 4818 | */ |
| 4819 | SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*); |
| 4820 | |
| 4821 | /* |
| 4822 | ** CAPI3REF: Copy And Free SQL Values |
| 4823 | ** METHOD: sqlite3_value |
| 4824 | ** |
| @@ -4830,12 +4847,12 @@ | |
| 4830 | ** |
| 4831 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4832 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4833 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4834 | */ |
| 4835 | SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*); |
| 4836 | SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*); |
| 4837 | |
| 4838 | /* |
| 4839 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4840 | ** METHOD: sqlite3_context |
| 4841 | ** |
| @@ -4876,11 +4893,11 @@ | |
| 4876 | ** function. |
| 4877 | ** |
| 4878 | ** This routine must be called from the same thread in which |
| 4879 | ** the aggregate SQL function is running. |
| 4880 | */ |
| 4881 | SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); |
| 4882 | |
| 4883 | /* |
| 4884 | ** CAPI3REF: User Data For Functions |
| 4885 | ** METHOD: sqlite3_context |
| 4886 | ** |
| @@ -4891,11 +4908,11 @@ | |
| 4891 | ** registered the application defined function. |
| 4892 | ** |
| 4893 | ** This routine must be called from the same thread in which |
| 4894 | ** the application-defined function is running. |
| 4895 | */ |
| 4896 | SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*); |
| 4897 | |
| 4898 | /* |
| 4899 | ** CAPI3REF: Database Connection For Functions |
| 4900 | ** METHOD: sqlite3_context |
| 4901 | ** |
| @@ -4903,11 +4920,11 @@ | |
| 4903 | ** the pointer to the [database connection] (the 1st parameter) |
| 4904 | ** of the [sqlite3_create_function()] |
| 4905 | ** and [sqlite3_create_function16()] routines that originally |
| 4906 | ** registered the application defined function. |
| 4907 | */ |
| 4908 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*); |
| 4909 | |
| 4910 | /* |
| 4911 | ** CAPI3REF: Function Auxiliary Data |
| 4912 | ** METHOD: sqlite3_context |
| 4913 | ** |
| @@ -4956,12 +4973,12 @@ | |
| 4956 | ** values and [parameters] and expressions composed from the same.)^ |
| 4957 | ** |
| 4958 | ** These routines must be called from the same thread in which |
| 4959 | ** the SQL function is running. |
| 4960 | */ |
| 4961 | SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4962 | SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); |
| 4963 | |
| 4964 | |
| 4965 | /* |
| 4966 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 4967 | ** |
| @@ -4974,11 +4991,11 @@ | |
| 4974 | ** the content before returning. |
| 4975 | ** |
| 4976 | ** The typedef is necessary to work around problems in certain |
| 4977 | ** C++ compilers. |
| 4978 | */ |
| 4979 | typedef void (*sqlite3_destructor_type)(void*); |
| 4980 | #define SQLITE_STATIC ((sqlite3_destructor_type)0) |
| 4981 | #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) |
| 4982 | |
| 4983 | /* |
| 4984 | ** CAPI3REF: Setting The Result Of An SQL Function |
| @@ -5093,31 +5110,31 @@ | |
| 5093 | ** |
| 5094 | ** If these routines are called from within the different thread |
| 5095 | ** than the one containing the application-defined function that received |
| 5096 | ** the [sqlite3_context] pointer, the results are undefined. |
| 5097 | */ |
| 5098 | SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 5099 | SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*, |
| 5100 | sqlite3_uint64,void(*)(void*)); |
| 5101 | SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double); |
| 5102 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int); |
| 5103 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int); |
| 5104 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*); |
| 5105 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*); |
| 5106 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int); |
| 5107 | SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int); |
| 5108 | SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); |
| 5109 | SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*); |
| 5110 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); |
| 5111 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, |
| 5112 | void(*)(void*), unsigned char encoding); |
| 5113 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 5114 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 5115 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 5116 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 5117 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 5118 | SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); |
| 5119 | |
| 5120 | |
| 5121 | /* |
| 5122 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 5123 | ** METHOD: sqlite3_context |
| @@ -5128,11 +5145,11 @@ | |
| 5128 | ** of the subtype T are preserved in current versions of SQLite; |
| 5129 | ** higher order bits are discarded. |
| 5130 | ** The number of subtype bytes preserved by SQLite might increase |
| 5131 | ** in future releases of SQLite. |
| 5132 | */ |
| 5133 | SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int); |
| 5134 | |
| 5135 | /* |
| 5136 | ** CAPI3REF: Define New Collating Sequences |
| 5137 | ** METHOD: sqlite3 |
| 5138 | ** |
| @@ -5210,31 +5227,31 @@ | |
| 5210 | ** is unfortunate but cannot be changed without breaking backwards |
| 5211 | ** compatibility. |
| 5212 | ** |
| 5213 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 5214 | */ |
| 5215 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( |
| 5216 | sqlite3*, |
| 5217 | const char *zName, |
| 5218 | int eTextRep, |
| 5219 | void *pArg, |
| 5220 | int(*xCompare)(void*,int,const void*,int,const void*) |
| 5221 | ); |
| 5222 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( |
| 5223 | sqlite3*, |
| 5224 | const char *zName, |
| 5225 | int eTextRep, |
| 5226 | void *pArg, |
| 5227 | int(*xCompare)(void*,int,const void*,int,const void*), |
| 5228 | void(*xDestroy)(void*) |
| 5229 | ); |
| 5230 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( |
| 5231 | sqlite3*, |
| 5232 | const void *zName, |
| 5233 | int eTextRep, |
| 5234 | void *pArg, |
| 5235 | int(*xCompare)(void*,int,const void*,int,const void*) |
| 5236 | ); |
| 5237 | |
| 5238 | /* |
| 5239 | ** CAPI3REF: Collation Needed Callbacks |
| 5240 | ** METHOD: sqlite3 |
| @@ -5260,19 +5277,19 @@ | |
| 5260 | ** |
| 5261 | ** The callback function should register the desired collation using |
| 5262 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5263 | ** [sqlite3_create_collation_v2()]. |
| 5264 | */ |
| 5265 | SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( |
| 5266 | sqlite3*, |
| 5267 | void*, |
| 5268 | void(*)(void*,sqlite3*,int eTextRep,const char*) |
| 5269 | ); |
| 5270 | SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( |
| 5271 | sqlite3*, |
| 5272 | void*, |
| 5273 | void(*)(void*,sqlite3*,int eTextRep,const void*) |
| 5274 | ); |
| 5275 | |
| 5276 | #ifdef SQLITE_HAS_CODEC |
| 5277 | /* |
| 5278 | ** Specify the key for an encrypted database. This routine should be |
| @@ -5279,15 +5296,15 @@ | |
| 5279 | ** called right after sqlite3_open(). |
| 5280 | ** |
| 5281 | ** The code to implement this API is not available in the public release |
| 5282 | ** of SQLite. |
| 5283 | */ |
| 5284 | SQLITE_API int SQLITE_STDCALL sqlite3_key( |
| 5285 | sqlite3 *db, /* Database to be rekeyed */ |
| 5286 | const void *pKey, int nKey /* The key */ |
| 5287 | ); |
| 5288 | SQLITE_API int SQLITE_STDCALL sqlite3_key_v2( |
| 5289 | sqlite3 *db, /* Database to be rekeyed */ |
| 5290 | const char *zDbName, /* Name of the database */ |
| 5291 | const void *pKey, int nKey /* The key */ |
| 5292 | ); |
| 5293 | |
| @@ -5297,35 +5314,35 @@ | |
| 5297 | ** database is decrypted. |
| 5298 | ** |
| 5299 | ** The code to implement this API is not available in the public release |
| 5300 | ** of SQLite. |
| 5301 | */ |
| 5302 | SQLITE_API int SQLITE_STDCALL sqlite3_rekey( |
| 5303 | sqlite3 *db, /* Database to be rekeyed */ |
| 5304 | const void *pKey, int nKey /* The new key */ |
| 5305 | ); |
| 5306 | SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2( |
| 5307 | sqlite3 *db, /* Database to be rekeyed */ |
| 5308 | const char *zDbName, /* Name of the database */ |
| 5309 | const void *pKey, int nKey /* The new key */ |
| 5310 | ); |
| 5311 | |
| 5312 | /* |
| 5313 | ** Specify the activation key for a SEE database. Unless |
| 5314 | ** activated, none of the SEE routines will work. |
| 5315 | */ |
| 5316 | SQLITE_API void SQLITE_STDCALL sqlite3_activate_see( |
| 5317 | const char *zPassPhrase /* Activation phrase */ |
| 5318 | ); |
| 5319 | #endif |
| 5320 | |
| 5321 | #ifdef SQLITE_ENABLE_CEROD |
| 5322 | /* |
| 5323 | ** Specify the activation key for a CEROD database. Unless |
| 5324 | ** activated, none of the CEROD routines will work. |
| 5325 | */ |
| 5326 | SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod( |
| 5327 | const char *zPassPhrase /* Activation phrase */ |
| 5328 | ); |
| 5329 | #endif |
| 5330 | |
| 5331 | /* |
| @@ -5343,11 +5360,11 @@ | |
| 5343 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5344 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5345 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5346 | ** in the previous paragraphs. |
| 5347 | */ |
| 5348 | SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int); |
| 5349 | |
| 5350 | /* |
| 5351 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5352 | ** |
| 5353 | ** ^(If this global variable is made to point to a string which is |
| @@ -5462,11 +5479,11 @@ | |
| 5462 | ** |
| 5463 | ** If another thread changes the autocommit status of the database |
| 5464 | ** connection while this routine is running, then the return value |
| 5465 | ** is undefined. |
| 5466 | */ |
| 5467 | SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*); |
| 5468 | |
| 5469 | /* |
| 5470 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5471 | ** METHOD: sqlite3_stmt |
| 5472 | ** |
| @@ -5475,11 +5492,11 @@ | |
| 5475 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5476 | ** that was the first argument |
| 5477 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5478 | ** create the statement in the first place. |
| 5479 | */ |
| 5480 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*); |
| 5481 | |
| 5482 | /* |
| 5483 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5484 | ** METHOD: sqlite3 |
| 5485 | ** |
| @@ -5492,21 +5509,21 @@ | |
| 5492 | ** ^The filename returned by this function is the output of the |
| 5493 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5494 | ** will be an absolute pathname, even if the filename used |
| 5495 | ** to open the database originally was a URI or relative pathname. |
| 5496 | */ |
| 5497 | SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 5498 | |
| 5499 | /* |
| 5500 | ** CAPI3REF: Determine if a database is read-only |
| 5501 | ** METHOD: sqlite3 |
| 5502 | ** |
| 5503 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5504 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5505 | ** the name of a database on connection D. |
| 5506 | */ |
| 5507 | SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); |
| 5508 | |
| 5509 | /* |
| 5510 | ** CAPI3REF: Find the next prepared statement |
| 5511 | ** METHOD: sqlite3 |
| 5512 | ** |
| @@ -5518,11 +5535,11 @@ | |
| 5518 | ** |
| 5519 | ** The [database connection] pointer D in a call to |
| 5520 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5521 | ** connection and in particular must not be a NULL pointer. |
| 5522 | */ |
| 5523 | SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); |
| 5524 | |
| 5525 | /* |
| 5526 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5527 | ** METHOD: sqlite3 |
| 5528 | ** |
| @@ -5567,12 +5584,12 @@ | |
| 5567 | ** ^The rollback callback is not invoked if a transaction is |
| 5568 | ** automatically rolled back because the database connection is closed. |
| 5569 | ** |
| 5570 | ** See also the [sqlite3_update_hook()] interface. |
| 5571 | */ |
| 5572 | SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); |
| 5573 | SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); |
| 5574 | |
| 5575 | /* |
| 5576 | ** CAPI3REF: Data Change Notification Callbacks |
| 5577 | ** METHOD: sqlite3 |
| 5578 | ** |
| @@ -5619,13 +5636,13 @@ | |
| 5619 | ** the first call on D. |
| 5620 | ** |
| 5621 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5622 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5623 | */ |
| 5624 | SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( |
| 5625 | sqlite3*, |
| 5626 | void(*)(void *,int ,char const *,char const *,sqlite3_int64), |
| 5627 | void* |
| 5628 | ); |
| 5629 | |
| 5630 | /* |
| 5631 | ** CAPI3REF: Enable Or Disable Shared Pager Cache |
| @@ -5659,11 +5676,11 @@ | |
| 5659 | ** This interface is threadsafe on processors where writing a |
| 5660 | ** 32-bit integer is atomic. |
| 5661 | ** |
| 5662 | ** See Also: [SQLite Shared-Cache Mode] |
| 5663 | */ |
| 5664 | SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int); |
| 5665 | |
| 5666 | /* |
| 5667 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5668 | ** |
| 5669 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| @@ -5675,11 +5692,11 @@ | |
| 5675 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5676 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5677 | ** |
| 5678 | ** See also: [sqlite3_db_release_memory()] |
| 5679 | */ |
| 5680 | SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int); |
| 5681 | |
| 5682 | /* |
| 5683 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5684 | ** METHOD: sqlite3 |
| 5685 | ** |
| @@ -5689,11 +5706,11 @@ | |
| 5689 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5690 | ** omitted. |
| 5691 | ** |
| 5692 | ** See also: [sqlite3_release_memory()] |
| 5693 | */ |
| 5694 | SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*); |
| 5695 | |
| 5696 | /* |
| 5697 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5698 | ** |
| 5699 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| @@ -5741,11 +5758,11 @@ | |
| 5741 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5742 | ** |
| 5743 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5744 | ** changes in future releases of SQLite. |
| 5745 | */ |
| 5746 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 5747 | |
| 5748 | /* |
| 5749 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5750 | ** DEPRECATED |
| 5751 | ** |
| @@ -5752,11 +5769,11 @@ | |
| 5752 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5753 | ** interface. This routine is provided for historical compatibility |
| 5754 | ** only. All new applications should use the |
| 5755 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5756 | */ |
| 5757 | SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N); |
| 5758 | |
| 5759 | |
| 5760 | /* |
| 5761 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5762 | ** METHOD: sqlite3 |
| @@ -5822,11 +5839,11 @@ | |
| 5822 | ** |
| 5823 | ** ^This function causes all database schemas to be read from disk and |
| 5824 | ** parsed, if that has not already been done, and returns an error if |
| 5825 | ** any errors are encountered while loading the schema. |
| 5826 | */ |
| 5827 | SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( |
| 5828 | sqlite3 *db, /* Connection handle */ |
| 5829 | const char *zDbName, /* Database name or NULL */ |
| 5830 | const char *zTableName, /* Table name */ |
| 5831 | const char *zColumnName, /* Column name */ |
| 5832 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -5878,11 +5895,11 @@ | |
| 5878 | ** disabled and prevent SQL injections from giving attackers |
| 5879 | ** access to extension loading capabilities. |
| 5880 | ** |
| 5881 | ** See also the [load_extension() SQL function]. |
| 5882 | */ |
| 5883 | SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( |
| 5884 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5885 | const char *zFile, /* Name of the shared library containing extension */ |
| 5886 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5887 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5888 | ); |
| @@ -5910,11 +5927,11 @@ | |
| 5910 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5911 | ** rather than this interface, so the [load_extension()] SQL function |
| 5912 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5913 | ** access to extension loading capabilities. |
| 5914 | */ |
| 5915 | SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); |
| 5916 | |
| 5917 | /* |
| 5918 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5919 | ** |
| 5920 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| @@ -5948,11 +5965,14 @@ | |
| 5948 | ** will be called more than once for each database connection that is opened. |
| 5949 | ** |
| 5950 | ** See also: [sqlite3_reset_auto_extension()] |
| 5951 | ** and [sqlite3_cancel_auto_extension()] |
| 5952 | */ |
| 5953 | SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void)); |
| 5954 | |
| 5955 | /* |
| 5956 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5957 | ** |
| 5958 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| @@ -5960,19 +5980,21 @@ | |
| 5960 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5961 | ** routine returns 1 if initialization routine X was successfully |
| 5962 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5963 | ** routines. |
| 5964 | */ |
| 5965 | SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); |
| 5966 | |
| 5967 | /* |
| 5968 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5969 | ** |
| 5970 | ** ^This interface disables all automatic extensions previously |
| 5971 | ** registered using [sqlite3_auto_extension()]. |
| 5972 | */ |
| 5973 | SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void); |
| 5974 | |
| 5975 | /* |
| 5976 | ** The interface to the virtual-table mechanism is currently considered |
| 5977 | ** to be experimental. The interface might change in incompatible ways. |
| 5978 | ** If this is a problem for you, do not use the interface at this time. |
| @@ -6005,41 +6027,41 @@ | |
| 6005 | ** of this structure must not change while it is registered with |
| 6006 | ** any database connection. |
| 6007 | */ |
| 6008 | struct sqlite3_module { |
| 6009 | int iVersion; |
| 6010 | int (*xCreate)(sqlite3*, void *pAux, |
| 6011 | int argc, const char *const*argv, |
| 6012 | sqlite3_vtab **ppVTab, char**); |
| 6013 | int (*xConnect)(sqlite3*, void *pAux, |
| 6014 | int argc, const char *const*argv, |
| 6015 | sqlite3_vtab **ppVTab, char**); |
| 6016 | int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); |
| 6017 | int (*xDisconnect)(sqlite3_vtab *pVTab); |
| 6018 | int (*xDestroy)(sqlite3_vtab *pVTab); |
| 6019 | int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); |
| 6020 | int (*xClose)(sqlite3_vtab_cursor*); |
| 6021 | int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, |
| 6022 | int argc, sqlite3_value **argv); |
| 6023 | int (*xNext)(sqlite3_vtab_cursor*); |
| 6024 | int (*xEof)(sqlite3_vtab_cursor*); |
| 6025 | int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); |
| 6026 | int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); |
| 6027 | int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); |
| 6028 | int (*xBegin)(sqlite3_vtab *pVTab); |
| 6029 | int (*xSync)(sqlite3_vtab *pVTab); |
| 6030 | int (*xCommit)(sqlite3_vtab *pVTab); |
| 6031 | int (*xRollback)(sqlite3_vtab *pVTab); |
| 6032 | int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, |
| 6033 | void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), |
| 6034 | void **ppArg); |
| 6035 | int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); |
| 6036 | /* The methods above are in version 1 of the sqlite_module object. Those |
| 6037 | ** below are for version 2 and greater. */ |
| 6038 | int (*xSavepoint)(sqlite3_vtab *pVTab, int); |
| 6039 | int (*xRelease)(sqlite3_vtab *pVTab, int); |
| 6040 | int (*xRollbackTo)(sqlite3_vtab *pVTab, int); |
| 6041 | }; |
| 6042 | |
| 6043 | /* |
| 6044 | ** CAPI3REF: Virtual Table Indexing Information |
| 6045 | ** KEYWORDS: sqlite3_index_info |
| @@ -6213,22 +6235,22 @@ | |
| 6213 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 6214 | ** ^The sqlite3_create_module() |
| 6215 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 6216 | ** destructor. |
| 6217 | */ |
| 6218 | SQLITE_API int SQLITE_STDCALL sqlite3_create_module( |
| 6219 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6220 | const char *zName, /* Name of the module */ |
| 6221 | const sqlite3_module *p, /* Methods for the module */ |
| 6222 | void *pClientData /* Client data for xCreate/xConnect */ |
| 6223 | ); |
| 6224 | SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( |
| 6225 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6226 | const char *zName, /* Name of the module */ |
| 6227 | const sqlite3_module *p, /* Methods for the module */ |
| 6228 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 6229 | void(*xDestroy)(void*) /* Module destructor function */ |
| 6230 | ); |
| 6231 | |
| 6232 | /* |
| 6233 | ** CAPI3REF: Virtual Table Instance Object |
| 6234 | ** KEYWORDS: sqlite3_vtab |
| @@ -6282,11 +6304,11 @@ | |
| 6282 | ** ^The [xCreate] and [xConnect] methods of a |
| 6283 | ** [virtual table module] call this interface |
| 6284 | ** to declare the format (the names and datatypes of the columns) of |
| 6285 | ** the virtual tables they implement. |
| 6286 | */ |
| 6287 | SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); |
| 6288 | |
| 6289 | /* |
| 6290 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6291 | ** METHOD: sqlite3 |
| 6292 | ** |
| @@ -6301,11 +6323,11 @@ | |
| 6301 | ** of the new function always causes an exception to be thrown. So |
| 6302 | ** the new function is not good for anything by itself. Its only |
| 6303 | ** purpose is to be a placeholder function that can be overloaded |
| 6304 | ** by a [virtual table]. |
| 6305 | */ |
| 6306 | SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 6307 | |
| 6308 | /* |
| 6309 | ** The interface to the virtual-table mechanism defined above (back up |
| 6310 | ** to a comment remarkably similar to this one) is currently considered |
| 6311 | ** to be experimental. The interface might change in incompatible ways. |
| @@ -6400,11 +6422,11 @@ | |
| 6400 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6401 | ** |
| 6402 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6403 | ** be released by a call to [sqlite3_blob_close()]. |
| 6404 | */ |
| 6405 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( |
| 6406 | sqlite3*, |
| 6407 | const char *zDb, |
| 6408 | const char *zTable, |
| 6409 | const char *zColumn, |
| 6410 | sqlite3_int64 iRow, |
| @@ -6433,11 +6455,11 @@ | |
| 6433 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6434 | ** always returns zero. |
| 6435 | ** |
| 6436 | ** ^This function sets the database handle error code and message. |
| 6437 | */ |
| 6438 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); |
| 6439 | |
| 6440 | /* |
| 6441 | ** CAPI3REF: Close A BLOB Handle |
| 6442 | ** DESTRUCTOR: sqlite3_blob |
| 6443 | ** |
| @@ -6456,11 +6478,11 @@ | |
| 6456 | ** with a null pointer (such as would be returned by a failed call to |
| 6457 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6458 | ** is passed a valid open blob handle, the values returned by the |
| 6459 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6460 | */ |
| 6461 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *); |
| 6462 | |
| 6463 | /* |
| 6464 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6465 | ** METHOD: sqlite3_blob |
| 6466 | ** |
| @@ -6472,11 +6494,11 @@ | |
| 6472 | ** This routine only works on a [BLOB handle] which has been created |
| 6473 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6474 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6475 | ** to this routine results in undefined and probably undesirable behavior. |
| 6476 | */ |
| 6477 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *); |
| 6478 | |
| 6479 | /* |
| 6480 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6481 | ** METHOD: sqlite3_blob |
| 6482 | ** |
| @@ -6501,11 +6523,11 @@ | |
| 6501 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6502 | ** to this routine results in undefined and probably undesirable behavior. |
| 6503 | ** |
| 6504 | ** See also: [sqlite3_blob_write()]. |
| 6505 | */ |
| 6506 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); |
| 6507 | |
| 6508 | /* |
| 6509 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6510 | ** METHOD: sqlite3_blob |
| 6511 | ** |
| @@ -6543,11 +6565,11 @@ | |
| 6543 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6544 | ** to this routine results in undefined and probably undesirable behavior. |
| 6545 | ** |
| 6546 | ** See also: [sqlite3_blob_read()]. |
| 6547 | */ |
| 6548 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); |
| 6549 | |
| 6550 | /* |
| 6551 | ** CAPI3REF: Virtual File System Objects |
| 6552 | ** |
| 6553 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| @@ -6574,13 +6596,13 @@ | |
| 6574 | ** |
| 6575 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6576 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6577 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6578 | */ |
| 6579 | SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName); |
| 6580 | SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); |
| 6581 | SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*); |
| 6582 | |
| 6583 | /* |
| 6584 | ** CAPI3REF: Mutexes |
| 6585 | ** |
| 6586 | ** The SQLite core uses these routines for thread |
| @@ -6692,15 +6714,15 @@ | |
| 6692 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6693 | ** behave as no-ops. |
| 6694 | ** |
| 6695 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6696 | */ |
| 6697 | SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); |
| 6698 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); |
| 6699 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); |
| 6700 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); |
| 6701 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*); |
| 6702 | |
| 6703 | /* |
| 6704 | ** CAPI3REF: Mutex Methods Object |
| 6705 | ** |
| 6706 | ** An instance of this structure defines the low-level routines |
| @@ -6765,19 +6787,19 @@ | |
| 6765 | ** If xMutexInit fails in any way, it is expected to clean up after itself |
| 6766 | ** prior to returning. |
| 6767 | */ |
| 6768 | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; |
| 6769 | struct sqlite3_mutex_methods { |
| 6770 | int (*xMutexInit)(void); |
| 6771 | int (*xMutexEnd)(void); |
| 6772 | sqlite3_mutex *(*xMutexAlloc)(int); |
| 6773 | void (*xMutexFree)(sqlite3_mutex *); |
| 6774 | void (*xMutexEnter)(sqlite3_mutex *); |
| 6775 | int (*xMutexTry)(sqlite3_mutex *); |
| 6776 | void (*xMutexLeave)(sqlite3_mutex *); |
| 6777 | int (*xMutexHeld)(sqlite3_mutex *); |
| 6778 | int (*xMutexNotheld)(sqlite3_mutex *); |
| 6779 | }; |
| 6780 | |
| 6781 | /* |
| 6782 | ** CAPI3REF: Mutex Verification Routines |
| 6783 | ** |
| @@ -6806,12 +6828,12 @@ | |
| 6806 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6807 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6808 | ** interface should also return 1 when given a NULL pointer. |
| 6809 | */ |
| 6810 | #ifndef NDEBUG |
| 6811 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*); |
| 6812 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*); |
| 6813 | #endif |
| 6814 | |
| 6815 | /* |
| 6816 | ** CAPI3REF: Mutex Types |
| 6817 | ** |
| @@ -6847,11 +6869,11 @@ | |
| 6847 | ** serializes access to the [database connection] given in the argument |
| 6848 | ** when the [threading mode] is Serialized. |
| 6849 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6850 | ** routine returns a NULL pointer. |
| 6851 | */ |
| 6852 | SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*); |
| 6853 | |
| 6854 | /* |
| 6855 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6856 | ** METHOD: sqlite3 |
| 6857 | ** |
| @@ -6882,11 +6904,11 @@ | |
| 6882 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6883 | ** xFileControl method. |
| 6884 | ** |
| 6885 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6886 | */ |
| 6887 | SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); |
| 6888 | |
| 6889 | /* |
| 6890 | ** CAPI3REF: Testing Interface |
| 6891 | ** |
| 6892 | ** ^The sqlite3_test_control() interface is used to read out internal |
| @@ -6964,12 +6986,12 @@ | |
| 6964 | ** be represented by a 32-bit integer, then the values returned by |
| 6965 | ** sqlite3_status() are undefined. |
| 6966 | ** |
| 6967 | ** See also: [sqlite3_db_status()] |
| 6968 | */ |
| 6969 | SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); |
| 6970 | SQLITE_API int SQLITE_STDCALL sqlite3_status64( |
| 6971 | int op, |
| 6972 | sqlite3_int64 *pCurrent, |
| 6973 | sqlite3_int64 *pHighwater, |
| 6974 | int resetFlag |
| 6975 | ); |
| @@ -7090,11 +7112,11 @@ | |
| 7090 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 7091 | ** non-zero [error code] on failure. |
| 7092 | ** |
| 7093 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 7094 | */ |
| 7095 | SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); |
| 7096 | |
| 7097 | /* |
| 7098 | ** CAPI3REF: Status Parameters for database connections |
| 7099 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 7100 | ** |
| @@ -7233,11 +7255,11 @@ | |
| 7233 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 7234 | ** interface call returns. |
| 7235 | ** |
| 7236 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 7237 | */ |
| 7238 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); |
| 7239 | |
| 7240 | /* |
| 7241 | ** CAPI3REF: Status Parameters for prepared statements |
| 7242 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 7243 | ** |
| @@ -7469,22 +7491,22 @@ | |
| 7469 | */ |
| 7470 | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; |
| 7471 | struct sqlite3_pcache_methods2 { |
| 7472 | int iVersion; |
| 7473 | void *pArg; |
| 7474 | int (*xInit)(void*); |
| 7475 | void (*xShutdown)(void*); |
| 7476 | sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); |
| 7477 | void (*xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7478 | int (*xPagecount)(sqlite3_pcache*); |
| 7479 | sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7480 | void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); |
| 7481 | void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, |
| 7482 | unsigned oldKey, unsigned newKey); |
| 7483 | void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7484 | void (*xDestroy)(sqlite3_pcache*); |
| 7485 | void (*xShrink)(sqlite3_pcache*); |
| 7486 | }; |
| 7487 | |
| 7488 | /* |
| 7489 | ** This is the obsolete pcache_methods object that has now been replaced |
| 7490 | ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is |
| @@ -7491,20 +7513,20 @@ | |
| 7491 | ** retained in the header file for backwards compatibility only. |
| 7492 | */ |
| 7493 | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; |
| 7494 | struct sqlite3_pcache_methods { |
| 7495 | void *pArg; |
| 7496 | int (*xInit)(void*); |
| 7497 | void (*xShutdown)(void*); |
| 7498 | sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); |
| 7499 | void (*xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7500 | int (*xPagecount)(sqlite3_pcache*); |
| 7501 | void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7502 | void (*xUnpin)(sqlite3_pcache*, void*, int discard); |
| 7503 | void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); |
| 7504 | void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7505 | void (*xDestroy)(sqlite3_pcache*); |
| 7506 | }; |
| 7507 | |
| 7508 | |
| 7509 | /* |
| 7510 | ** CAPI3REF: Online Backup Object |
| @@ -7702,20 +7724,20 @@ | |
| 7702 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7703 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7704 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7705 | ** possible that they return invalid values. |
| 7706 | */ |
| 7707 | SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( |
| 7708 | sqlite3 *pDest, /* Destination database handle */ |
| 7709 | const char *zDestName, /* Destination database name */ |
| 7710 | sqlite3 *pSource, /* Source database handle */ |
| 7711 | const char *zSourceName /* Source database name */ |
| 7712 | ); |
| 7713 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage); |
| 7714 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p); |
| 7715 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p); |
| 7716 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p); |
| 7717 | |
| 7718 | /* |
| 7719 | ** CAPI3REF: Unlock Notification |
| 7720 | ** METHOD: sqlite3 |
| 7721 | ** |
| @@ -7828,13 +7850,13 @@ | |
| 7828 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7829 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7830 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7831 | ** SQLITE_LOCKED.)^ |
| 7832 | */ |
| 7833 | SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( |
| 7834 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7835 | void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ |
| 7836 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7837 | ); |
| 7838 | |
| 7839 | |
| 7840 | /* |
| @@ -7843,12 +7865,12 @@ | |
| 7843 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7844 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7845 | ** strings in a case-independent fashion, using the same definition of "case |
| 7846 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7847 | */ |
| 7848 | SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *); |
| 7849 | SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int); |
| 7850 | |
| 7851 | /* |
| 7852 | ** CAPI3REF: String Globbing |
| 7853 | * |
| 7854 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| @@ -7861,11 +7883,11 @@ | |
| 7861 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7862 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7863 | ** |
| 7864 | ** See also: [sqlite3_strlike()]. |
| 7865 | */ |
| 7866 | SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr); |
| 7867 | |
| 7868 | /* |
| 7869 | ** CAPI3REF: String LIKE Matching |
| 7870 | * |
| 7871 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| @@ -7884,11 +7906,11 @@ | |
| 7884 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7885 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7886 | ** |
| 7887 | ** See also: [sqlite3_strglob()]. |
| 7888 | */ |
| 7889 | SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); |
| 7890 | |
| 7891 | /* |
| 7892 | ** CAPI3REF: Error Logging Interface |
| 7893 | ** |
| 7894 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| @@ -7943,13 +7965,13 @@ | |
| 7943 | ** previously registered write-ahead log callback. ^Note that the |
| 7944 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7945 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7946 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7947 | */ |
| 7948 | SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( |
| 7949 | sqlite3*, |
| 7950 | int(*)(void *,sqlite3*,const char*,int), |
| 7951 | void* |
| 7952 | ); |
| 7953 | |
| 7954 | /* |
| 7955 | ** CAPI3REF: Configure an auto-checkpoint |
| @@ -7978,11 +8000,11 @@ | |
| 7978 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 7979 | ** pages. The use of this interface |
| 7980 | ** is only necessary if the default setting is found to be suboptimal |
| 7981 | ** for a particular application. |
| 7982 | */ |
| 7983 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); |
| 7984 | |
| 7985 | /* |
| 7986 | ** CAPI3REF: Checkpoint a database |
| 7987 | ** METHOD: sqlite3 |
| 7988 | ** |
| @@ -8000,11 +8022,11 @@ | |
| 8000 | ** interface was added. This interface is retained for backwards |
| 8001 | ** compatibility and as a convenience for applications that need to manually |
| 8002 | ** start a callback but which do not need the full power (and corresponding |
| 8003 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 8004 | */ |
| 8005 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); |
| 8006 | |
| 8007 | /* |
| 8008 | ** CAPI3REF: Checkpoint a database |
| 8009 | ** METHOD: sqlite3 |
| 8010 | ** |
| @@ -8094,11 +8116,11 @@ | |
| 8094 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 8095 | ** |
| 8096 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 8097 | ** from SQL. |
| 8098 | */ |
| 8099 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( |
| 8100 | sqlite3 *db, /* Database handle */ |
| 8101 | const char *zDb, /* Name of attached database (or NULL) */ |
| 8102 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 8103 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 8104 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -8183,11 +8205,11 @@ | |
| 8183 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 8184 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 8185 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 8186 | ** [virtual table]. |
| 8187 | */ |
| 8188 | SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *); |
| 8189 | |
| 8190 | /* |
| 8191 | ** CAPI3REF: Conflict resolution modes |
| 8192 | ** KEYWORDS: {conflict resolution mode} |
| 8193 | ** |
| @@ -8288,11 +8310,11 @@ | |
| 8288 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8289 | ** that pOut points to unchanged. |
| 8290 | ** |
| 8291 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8292 | */ |
| 8293 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( |
| 8294 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8295 | int idx, /* Index of loop to report on */ |
| 8296 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8297 | void *pOut /* Result written here */ |
| 8298 | ); |
| @@ -8304,11 +8326,11 @@ | |
| 8304 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8305 | ** |
| 8306 | ** This API is only available if the library is built with pre-processor |
| 8307 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8308 | */ |
| 8309 | SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); |
| 8310 | |
| 8311 | /* |
| 8312 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8313 | ** |
| 8314 | ** ^If a write-transaction is open on [database connection] D when the |
| @@ -8336,11 +8358,11 @@ | |
| 8336 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8337 | ** |
| 8338 | ** ^This function does not set the database handle error code or message |
| 8339 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8340 | */ |
| 8341 | SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*); |
| 8342 | |
| 8343 | /* |
| 8344 | ** CAPI3REF: The pre-update hook. |
| 8345 | ** |
| 8346 | ** ^These interfaces are only available if SQLite is compiled using the |
| @@ -8416,13 +8438,13 @@ | |
| 8416 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8417 | ** triggers; and so forth. |
| 8418 | ** |
| 8419 | ** See also: [sqlite3_update_hook()] |
| 8420 | */ |
| 8421 | SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook( |
| 8422 | sqlite3 *db, |
| 8423 | void(*xPreUpdate)( |
| 8424 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8425 | sqlite3 *db, /* Database handle */ |
| 8426 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| 8427 | char const *zDb, /* Database name */ |
| 8428 | char const *zName, /* Table name */ |
| @@ -8429,14 +8451,14 @@ | |
| 8429 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8430 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8431 | ), |
| 8432 | void* |
| 8433 | ); |
| 8434 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); |
| 8435 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *); |
| 8436 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *); |
| 8437 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 8438 | |
| 8439 | /* |
| 8440 | ** CAPI3REF: Low-level system error code |
| 8441 | ** |
| 8442 | ** ^Attempt to return the underlying operating system error code or error |
| @@ -8444,11 +8466,11 @@ | |
| 8444 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8445 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8446 | ** called to get back the underlying "errno" that caused the problem, such |
| 8447 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8448 | */ |
| 8449 | SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*); |
| 8450 | |
| 8451 | /* |
| 8452 | ** CAPI3REF: Database Snapshot |
| 8453 | ** KEYWORDS: {snapshot} |
| 8454 | ** EXPERIMENTAL |
| @@ -8494,11 +8516,11 @@ | |
| 8494 | ** to avoid a memory leak. |
| 8495 | ** |
| 8496 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8497 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8498 | */ |
| 8499 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get( |
| 8500 | sqlite3 *db, |
| 8501 | const char *zSchema, |
| 8502 | sqlite3_snapshot **ppSnapshot |
| 8503 | ); |
| 8504 | |
| @@ -8532,11 +8554,11 @@ | |
| 8532 | ** database connection in order to make it ready to use snapshots.) |
| 8533 | ** |
| 8534 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8535 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8536 | */ |
| 8537 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open( |
| 8538 | sqlite3 *db, |
| 8539 | const char *zSchema, |
| 8540 | sqlite3_snapshot *pSnapshot |
| 8541 | ); |
| 8542 | |
| @@ -8549,11 +8571,11 @@ | |
| 8549 | ** using this routine to avoid a memory leak. |
| 8550 | ** |
| 8551 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8552 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8553 | */ |
| 8554 | SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*); |
| 8555 | |
| 8556 | /* |
| 8557 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8558 | ** EXPERIMENTAL |
| 8559 | ** |
| @@ -8573,11 +8595,11 @@ | |
| 8573 | ** |
| 8574 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8575 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8576 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8577 | */ |
| 8578 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp( |
| 8579 | sqlite3_snapshot *p1, |
| 8580 | sqlite3_snapshot *p2 |
| 8581 | ); |
| 8582 | |
| 8583 | /* |
| @@ -8631,14 +8653,14 @@ | |
| 8631 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8632 | ** R-Tree geometry query as follows: |
| 8633 | ** |
| 8634 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8635 | */ |
| 8636 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( |
| 8637 | sqlite3 *db, |
| 8638 | const char *zGeom, |
| 8639 | int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), |
| 8640 | void *pContext |
| 8641 | ); |
| 8642 | |
| 8643 | |
| 8644 | /* |
| @@ -8648,25 +8670,25 @@ | |
| 8648 | struct sqlite3_rtree_geometry { |
| 8649 | void *pContext; /* Copy of pContext passed to s_r_g_c() */ |
| 8650 | int nParam; /* Size of array aParam[] */ |
| 8651 | sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ |
| 8652 | void *pUser; /* Callback implementation user data */ |
| 8653 | void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ |
| 8654 | }; |
| 8655 | |
| 8656 | /* |
| 8657 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8658 | ** used as part of an R-Tree geometry query as follows: |
| 8659 | ** |
| 8660 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8661 | */ |
| 8662 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( |
| 8663 | sqlite3 *db, |
| 8664 | const char *zQueryFunc, |
| 8665 | int (*xQueryFunc)(sqlite3_rtree_query_info*), |
| 8666 | void *pContext, |
| 8667 | void (*xDestructor)(void*) |
| 8668 | ); |
| 8669 | |
| 8670 | |
| 8671 | /* |
| 8672 | ** A pointer to a structure of the following type is passed as the |
| @@ -8680,11 +8702,11 @@ | |
| 8680 | struct sqlite3_rtree_query_info { |
| 8681 | void *pContext; /* pContext from when function registered */ |
| 8682 | int nParam; /* Number of function parameters */ |
| 8683 | sqlite3_rtree_dbl *aParam; /* value of function parameters */ |
| 8684 | void *pUser; /* callback can use this, if desired */ |
| 8685 | void (*xDelUser)(void*); /* function to free pUser */ |
| 8686 | sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ |
| 8687 | unsigned int *anQueue; /* Number of pending entries in the queue */ |
| 8688 | int nCoord; /* Number of coordinates */ |
| 8689 | int iLevel; /* Level of current node or entry */ |
| 8690 | int mxLevel; /* The largest iLevel value in the tree */ |
| @@ -8876,11 +8898,11 @@ | |
| 8876 | ** If xFilter returns 0, changes is not tracked. Note that once a table is |
| 8877 | ** attached, xFilter will not be called again. |
| 8878 | */ |
| 8879 | void sqlite3session_table_filter( |
| 8880 | sqlite3_session *pSession, /* Session object */ |
| 8881 | int(*xFilter)( |
| 8882 | void *pCtx, /* Copy of third arg to _filter_table() */ |
| 8883 | const char *zTab /* Table name */ |
| 8884 | ), |
| 8885 | void *pCtx /* First argument passed to xFilter */ |
| 8886 | ); |
| @@ -9451,11 +9473,11 @@ | |
| 9451 | ** An sqlite3_changegroup object is used to combine two or more changesets |
| 9452 | ** (or patchsets) into a single changeset (or patchset). A single changegroup |
| 9453 | ** object may combine changesets or patchsets, but not both. The output is |
| 9454 | ** always in the same format as the input. |
| 9455 | ** |
| 9456 | ** If successful, this function returns SQLITE_OK and populates (*pp) with |
| 9457 | ** a pointer to a new sqlite3_changegroup object before returning. The caller |
| 9458 | ** should eventually free the returned object using a call to |
| 9459 | ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code |
| 9460 | ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. |
| 9461 | ** |
| @@ -9571,11 +9593,11 @@ | |
| 9571 | ** changes for tables that do not appear in the first changeset, they are |
| 9572 | ** appended onto the end of the output changeset, again in the order in |
| 9573 | ** which they are first encountered. |
| 9574 | ** |
| 9575 | ** If an error occurs, an SQLite error code is returned and the output |
| 9576 | ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK |
| 9577 | ** is returned and the output variables are set to the size of and a |
| 9578 | ** pointer to the output buffer, respectively. In this case it is the |
| 9579 | ** responsibility of the caller to eventually free the buffer using a |
| 9580 | ** call to sqlite3_free(). |
| 9581 | */ |
| @@ -9728,15 +9750,15 @@ | |
| 9728 | */ |
| 9729 | int sqlite3changeset_apply( |
| 9730 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9731 | int nChangeset, /* Size of changeset in bytes */ |
| 9732 | void *pChangeset, /* Changeset blob */ |
| 9733 | int(*xFilter)( |
| 9734 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9735 | const char *zTab /* Table name */ |
| 9736 | ), |
| 9737 | int(*xConflict)( |
| 9738 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9739 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9740 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9741 | ), |
| 9742 | void *pCtx /* First argument passed to xConflict */ |
| @@ -9873,20 +9895,20 @@ | |
| 9873 | ** </pre> |
| 9874 | ** |
| 9875 | ** Is replaced by: |
| 9876 | ** |
| 9877 | ** <pre> |
| 9878 | ** int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9879 | ** void *pIn, |
| 9880 | ** </pre> |
| 9881 | ** |
| 9882 | ** Each time the xInput callback is invoked by the sessions module, the first |
| 9883 | ** argument passed is a copy of the supplied pIn context pointer. The second |
| 9884 | ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no |
| 9885 | ** error occurs the xInput method should copy up to (*pnData) bytes of data |
| 9886 | ** into the buffer and set (*pnData) to the actual number of bytes copied |
| 9887 | ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) |
| 9888 | ** should be set to zero to indicate this. Or, if an error occurs, an SQLite |
| 9889 | ** error code should be returned. In all cases, if an xInput callback returns |
| 9890 | ** an error, all processing is abandoned and the streaming API function |
| 9891 | ** returns a copy of the error code to the caller. |
| 9892 | ** |
| @@ -9907,11 +9929,11 @@ | |
| 9907 | ** </pre> |
| 9908 | ** |
| 9909 | ** Is replaced by: |
| 9910 | ** |
| 9911 | ** <pre> |
| 9912 | ** int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9913 | ** void *pOut |
| 9914 | ** </pre> |
| 9915 | ** |
| 9916 | ** The xOutput callback is invoked zero or more times to return data to |
| 9917 | ** the application. The first parameter passed to each call is a copy of the |
| @@ -9927,58 +9949,58 @@ | |
| 9927 | ** parameter set to a value less than or equal to zero. Other than this, |
| 9928 | ** no guarantees are made as to the size of the chunks of data returned. |
| 9929 | */ |
| 9930 | int sqlite3changeset_apply_strm( |
| 9931 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9932 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 9933 | void *pIn, /* First arg for xInput */ |
| 9934 | int(*xFilter)( |
| 9935 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9936 | const char *zTab /* Table name */ |
| 9937 | ), |
| 9938 | int(*xConflict)( |
| 9939 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9940 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9941 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9942 | ), |
| 9943 | void *pCtx /* First argument passed to xConflict */ |
| 9944 | ); |
| 9945 | int sqlite3changeset_concat_strm( |
| 9946 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 9947 | void *pInA, |
| 9948 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| 9949 | void *pInB, |
| 9950 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9951 | void *pOut |
| 9952 | ); |
| 9953 | int sqlite3changeset_invert_strm( |
| 9954 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9955 | void *pIn, |
| 9956 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9957 | void *pOut |
| 9958 | ); |
| 9959 | int sqlite3changeset_start_strm( |
| 9960 | sqlite3_changeset_iter **pp, |
| 9961 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9962 | void *pIn |
| 9963 | ); |
| 9964 | int sqlite3session_changeset_strm( |
| 9965 | sqlite3_session *pSession, |
| 9966 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9967 | void *pOut |
| 9968 | ); |
| 9969 | int sqlite3session_patchset_strm( |
| 9970 | sqlite3_session *pSession, |
| 9971 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9972 | void *pOut |
| 9973 | ); |
| 9974 | int sqlite3changegroup_add_strm(sqlite3_changegroup*, |
| 9975 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9976 | void *pIn |
| 9977 | ); |
| 9978 | int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 9979 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9980 | void *pOut |
| 9981 | ); |
| 9982 | |
| 9983 | |
| 9984 | /* |
| @@ -10029,11 +10051,11 @@ | |
| 10029 | |
| 10030 | typedef struct Fts5ExtensionApi Fts5ExtensionApi; |
| 10031 | typedef struct Fts5Context Fts5Context; |
| 10032 | typedef struct Fts5PhraseIter Fts5PhraseIter; |
| 10033 | |
| 10034 | typedef void (*fts5_extension_function)( |
| 10035 | const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ |
| 10036 | Fts5Context *pFts, /* First arg to pass to pApi functions */ |
| 10037 | sqlite3_context *pCtx, /* Context for returning result/error */ |
| 10038 | int nVal, /* Number of values in apVal[] array */ |
| 10039 | sqlite3_value **apVal /* Array of trailing arguments */ |
| @@ -10080,15 +10102,15 @@ | |
| 10080 | ** This function may be quite inefficient if used with an FTS5 table |
| 10081 | ** created with the "columnsize=0" option. |
| 10082 | ** |
| 10083 | ** xColumnText: |
| 10084 | ** This function attempts to retrieve the text of column iCol of the |
| 10085 | ** current document. If successful, (*pz) is set to point to a buffer |
| 10086 | ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes |
| 10087 | ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, |
| 10088 | ** if an error occurs, an SQLite error code is returned and the final values |
| 10089 | ** of (*pz) and (*pn) are undefined. |
| 10090 | ** |
| 10091 | ** xPhraseCount: |
| 10092 | ** Returns the number of phrases in the current query expression. |
| 10093 | ** |
| 10094 | ** xPhraseSize: |
| @@ -10193,11 +10215,11 @@ | |
| 10193 | ** xRowCount(pFts5, pnRow) |
| 10194 | ** |
| 10195 | ** This function is used to retrieve the total number of rows in the table. |
| 10196 | ** In other words, the same value that would be returned by: |
| 10197 | ** |
| 10198 | ** SELECT count(*) FROM ftstable; |
| 10199 | ** |
| 10200 | ** xPhraseFirst() |
| 10201 | ** This function is used, along with type Fts5PhraseIter and the xPhraseNext |
| 10202 | ** method, to iterate through all instances of a single query phrase within |
| 10203 | ** the current row. This is the same information as is accessible via the |
| @@ -10260,43 +10282,43 @@ | |
| 10260 | ** See xPhraseFirstColumn above. |
| 10261 | */ |
| 10262 | struct Fts5ExtensionApi { |
| 10263 | int iVersion; /* Currently always set to 3 */ |
| 10264 | |
| 10265 | void *(*xUserData)(Fts5Context*); |
| 10266 | |
| 10267 | int (*xColumnCount)(Fts5Context*); |
| 10268 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 10269 | int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); |
| 10270 | |
| 10271 | int (*xTokenize)(Fts5Context*, |
| 10272 | const char *pText, int nText, /* Text to tokenize */ |
| 10273 | void *pCtx, /* Context passed to xToken() */ |
| 10274 | int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ |
| 10275 | ); |
| 10276 | |
| 10277 | int (*xPhraseCount)(Fts5Context*); |
| 10278 | int (*xPhraseSize)(Fts5Context*, int iPhrase); |
| 10279 | |
| 10280 | int (*xInstCount)(Fts5Context*, int *pnInst); |
| 10281 | int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); |
| 10282 | |
| 10283 | sqlite3_int64 (*xRowid)(Fts5Context*); |
| 10284 | int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); |
| 10285 | int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); |
| 10286 | |
| 10287 | int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, |
| 10288 | int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) |
| 10289 | ); |
| 10290 | int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); |
| 10291 | void *(*xGetAuxdata)(Fts5Context*, int bClear); |
| 10292 | |
| 10293 | int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); |
| 10294 | void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); |
| 10295 | |
| 10296 | int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); |
| 10297 | void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); |
| 10298 | }; |
| 10299 | |
| 10300 | /* |
| 10301 | ** CUSTOM AUXILIARY FUNCTIONS |
| 10302 | *************************************************************************/ |
| @@ -10320,11 +10342,11 @@ | |
| 10320 | ** The second and third arguments are an array of nul-terminated strings |
| 10321 | ** containing the tokenizer arguments, if any, specified following the |
| 10322 | ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used |
| 10323 | ** to create the FTS5 table. |
| 10324 | ** |
| 10325 | ** The final argument is an output variable. If successful, (*ppOut) |
| 10326 | ** should be set to point to the new tokenizer handle and SQLITE_OK |
| 10327 | ** returned. If an error occurs, some value other than SQLITE_OK should |
| 10328 | ** be returned. In this case, fts5 assumes that the final value of *ppOut |
| 10329 | ** is undefined. |
| 10330 | ** |
| @@ -10494,17 +10516,17 @@ | |
| 10494 | ** inefficient. |
| 10495 | */ |
| 10496 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| 10497 | typedef struct fts5_tokenizer fts5_tokenizer; |
| 10498 | struct fts5_tokenizer { |
| 10499 | int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); |
| 10500 | void (*xDelete)(Fts5Tokenizer*); |
| 10501 | int (*xTokenize)(Fts5Tokenizer*, |
| 10502 | void *pCtx, |
| 10503 | int flags, /* Mask of FTS5_TOKENIZE_* flags */ |
| 10504 | const char *pText, int nText, |
| 10505 | int (*xToken)( |
| 10506 | void *pCtx, /* Copy of 2nd argument to xTokenize() */ |
| 10507 | int tflags, /* Mask of FTS5_TOKEN_* flags */ |
| 10508 | const char *pToken, /* Pointer to buffer containing token */ |
| 10509 | int nToken, /* Size of token in bytes */ |
| 10510 | int iStart, /* Byte offset of token within input text */ |
| @@ -10533,33 +10555,33 @@ | |
| 10533 | typedef struct fts5_api fts5_api; |
| 10534 | struct fts5_api { |
| 10535 | int iVersion; /* Currently always set to 2 */ |
| 10536 | |
| 10537 | /* Create a new tokenizer */ |
| 10538 | int (*xCreateTokenizer)( |
| 10539 | fts5_api *pApi, |
| 10540 | const char *zName, |
| 10541 | void *pContext, |
| 10542 | fts5_tokenizer *pTokenizer, |
| 10543 | void (*xDestroy)(void*) |
| 10544 | ); |
| 10545 | |
| 10546 | /* Find an existing tokenizer */ |
| 10547 | int (*xFindTokenizer)( |
| 10548 | fts5_api *pApi, |
| 10549 | const char *zName, |
| 10550 | void **ppContext, |
| 10551 | fts5_tokenizer *pTokenizer |
| 10552 | ); |
| 10553 | |
| 10554 | /* Create a new auxiliary function */ |
| 10555 | int (*xCreateFunction)( |
| 10556 | fts5_api *pApi, |
| 10557 | const char *zName, |
| 10558 | void *pContext, |
| 10559 | fts5_extension_function xFunction, |
| 10560 | void (*xDestroy)(void*) |
| 10561 | ); |
| 10562 | }; |
| 10563 | |
| 10564 | /* |
| 10565 | ** END OF REGISTRATION API |
| @@ -11873,12 +11895,12 @@ | |
| 11873 | */ |
| 11874 | #ifdef SQLITE_OMIT_WSD |
| 11875 | #define SQLITE_WSD const |
| 11876 | #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v))) |
| 11877 | #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config) |
| 11878 | SQLITE_API int SQLITE_STDCALL sqlite3_wsd_init(int N, int J); |
| 11879 | SQLITE_API void *SQLITE_STDCALL sqlite3_wsd_find(void *K, int L); |
| 11880 | #else |
| 11881 | #define SQLITE_WSD |
| 11882 | #define GLOBAL(t,v) v |
| 11883 | #define sqlite3GlobalConfig sqlite3Config |
| 11884 | #endif |
| @@ -17165,12 +17187,14 @@ | |
| 17165 | "CASE_SENSITIVE_LIKE", |
| 17166 | #endif |
| 17167 | #if SQLITE_CHECK_PAGES |
| 17168 | "CHECK_PAGES", |
| 17169 | #endif |
| 17170 | #if defined(__clang__) && defined(__clang_version__) |
| 17171 | "COMPILER=clang-" __clang_version__, |
| 17172 | #elif defined(_MSC_VER) |
| 17173 | "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER), |
| 17174 | #elif defined(__GNUC__) && defined(__VERSION__) |
| 17175 | "COMPILER=gcc-" __VERSION__, |
| 17176 | #endif |
| @@ -17531,11 +17555,11 @@ | |
| 17531 | ** was used and false if not. |
| 17532 | ** |
| 17533 | ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix |
| 17534 | ** is not required for a match. |
| 17535 | */ |
| 17536 | SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName){ |
| 17537 | int i, n; |
| 17538 | |
| 17539 | #if SQLITE_ENABLE_API_ARMOR |
| 17540 | if( zOptName==0 ){ |
| 17541 | (void)SQLITE_MISUSE_BKPT; |
| @@ -17559,11 +17583,11 @@ | |
| 17559 | |
| 17560 | /* |
| 17561 | ** Return the N-th compile-time option string. If N is out of range, |
| 17562 | ** return a NULL pointer. |
| 17563 | */ |
| 17564 | SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N){ |
| 17565 | if( N>=0 && N<ArraySize(azCompileOpt) ){ |
| 17566 | return azCompileOpt[N]; |
| 17567 | } |
| 17568 | return 0; |
| 17569 | } |
| @@ -18269,11 +18293,11 @@ | |
| 18269 | } |
| 18270 | |
| 18271 | /* |
| 18272 | ** Query status information. |
| 18273 | */ |
| 18274 | SQLITE_API int SQLITE_STDCALL sqlite3_status64( |
| 18275 | int op, |
| 18276 | sqlite3_int64 *pCurrent, |
| 18277 | sqlite3_int64 *pHighwater, |
| 18278 | int resetFlag |
| 18279 | ){ |
| @@ -18294,11 +18318,11 @@ | |
| 18294 | } |
| 18295 | sqlite3_mutex_leave(pMutex); |
| 18296 | (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */ |
| 18297 | return SQLITE_OK; |
| 18298 | } |
| 18299 | SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ |
| 18300 | sqlite3_int64 iCur, iHwtr; |
| 18301 | int rc; |
| 18302 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 18303 | if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT; |
| 18304 | #endif |
| @@ -18311,11 +18335,11 @@ | |
| 18311 | } |
| 18312 | |
| 18313 | /* |
| 18314 | ** Query status information for a single database connection |
| 18315 | */ |
| 18316 | SQLITE_API int SQLITE_STDCALL sqlite3_db_status( |
| 18317 | sqlite3 *db, /* The database connection whose status is desired */ |
| 18318 | int op, /* Status verb */ |
| 18319 | int *pCurrent, /* Write current value here */ |
| 18320 | int *pHighwater, /* Write high-water mark here */ |
| 18321 | int resetFlag /* Reset high-water mark if true */ |
| @@ -19989,11 +20013,11 @@ | |
| 19989 | |
| 19990 | /* |
| 19991 | ** Locate a VFS by name. If no name is given, simply return the |
| 19992 | ** first VFS on the list. |
| 19993 | */ |
| 19994 | SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfs){ |
| 19995 | sqlite3_vfs *pVfs = 0; |
| 19996 | #if SQLITE_THREADSAFE |
| 19997 | sqlite3_mutex *mutex; |
| 19998 | #endif |
| 19999 | #ifndef SQLITE_OMIT_AUTOINIT |
| @@ -20035,11 +20059,11 @@ | |
| 20035 | /* |
| 20036 | ** Register a VFS with the system. It is harmless to register the same |
| 20037 | ** VFS multiple times. The new VFS becomes the default if makeDflt is |
| 20038 | ** true. |
| 20039 | */ |
| 20040 | SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ |
| 20041 | MUTEX_LOGIC(sqlite3_mutex *mutex;) |
| 20042 | #ifndef SQLITE_OMIT_AUTOINIT |
| 20043 | int rc = sqlite3_initialize(); |
| 20044 | if( rc ) return rc; |
| 20045 | #endif |
| @@ -20063,11 +20087,11 @@ | |
| 20063 | } |
| 20064 | |
| 20065 | /* |
| 20066 | ** Unregister a VFS so that it is no longer accessible. |
| 20067 | */ |
| 20068 | SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ |
| 20069 | #if SQLITE_THREADSAFE |
| 20070 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 20071 | #endif |
| 20072 | sqlite3_mutex_enter(mutex); |
| 20073 | vfsUnlink(pVfs); |
| @@ -22414,11 +22438,11 @@ | |
| 22414 | } |
| 22415 | |
| 22416 | /* |
| 22417 | ** Retrieve a pointer to a static mutex or allocate a new dynamic one. |
| 22418 | */ |
| 22419 | SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int id){ |
| 22420 | #ifndef SQLITE_OMIT_AUTOINIT |
| 22421 | if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0; |
| 22422 | if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0; |
| 22423 | #endif |
| 22424 | assert( sqlite3GlobalConfig.mutex.xMutexAlloc ); |
| @@ -22435,11 +22459,11 @@ | |
| 22435 | } |
| 22436 | |
| 22437 | /* |
| 22438 | ** Free a dynamic mutex. |
| 22439 | */ |
| 22440 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex *p){ |
| 22441 | if( p ){ |
| 22442 | assert( sqlite3GlobalConfig.mutex.xMutexFree ); |
| 22443 | sqlite3GlobalConfig.mutex.xMutexFree(p); |
| 22444 | } |
| 22445 | } |
| @@ -22446,11 +22470,11 @@ | |
| 22446 | |
| 22447 | /* |
| 22448 | ** Obtain the mutex p. If some other thread already has the mutex, block |
| 22449 | ** until it can be obtained. |
| 22450 | */ |
| 22451 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex *p){ |
| 22452 | if( p ){ |
| 22453 | assert( sqlite3GlobalConfig.mutex.xMutexEnter ); |
| 22454 | sqlite3GlobalConfig.mutex.xMutexEnter(p); |
| 22455 | } |
| 22456 | } |
| @@ -22457,11 +22481,11 @@ | |
| 22457 | |
| 22458 | /* |
| 22459 | ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another |
| 22460 | ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. |
| 22461 | */ |
| 22462 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex *p){ |
| 22463 | int rc = SQLITE_OK; |
| 22464 | if( p ){ |
| 22465 | assert( sqlite3GlobalConfig.mutex.xMutexTry ); |
| 22466 | return sqlite3GlobalConfig.mutex.xMutexTry(p); |
| 22467 | } |
| @@ -22472,11 +22496,11 @@ | |
| 22472 | ** The sqlite3_mutex_leave() routine exits a mutex that was previously |
| 22473 | ** entered by the same thread. The behavior is undefined if the mutex |
| 22474 | ** is not currently entered. If a NULL pointer is passed as an argument |
| 22475 | ** this function is a no-op. |
| 22476 | */ |
| 22477 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex *p){ |
| 22478 | if( p ){ |
| 22479 | assert( sqlite3GlobalConfig.mutex.xMutexLeave ); |
| 22480 | sqlite3GlobalConfig.mutex.xMutexLeave(p); |
| 22481 | } |
| 22482 | } |
| @@ -22484,15 +22508,15 @@ | |
| 22484 | #ifndef NDEBUG |
| 22485 | /* |
| 22486 | ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are |
| 22487 | ** intended for use inside assert() statements. |
| 22488 | */ |
| 22489 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex *p){ |
| 22490 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld ); |
| 22491 | return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p); |
| 22492 | } |
| 22493 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex *p){ |
| 22494 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld ); |
| 22495 | return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p); |
| 22496 | } |
| 22497 | #endif |
| 22498 | |
| @@ -23520,12 +23544,12 @@ | |
| 23520 | ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the |
| 23521 | ** "interlocked" magic used here is probably not strictly necessary. |
| 23522 | */ |
| 23523 | static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0; |
| 23524 | |
| 23525 | SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); /* os_win.c */ |
| 23526 | SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ |
| 23527 | |
| 23528 | static int winMutexInit(void){ |
| 23529 | /* The first to increment to 1 does actual initialization */ |
| 23530 | if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){ |
| 23531 | int i; |
| @@ -23821,11 +23845,11 @@ | |
| 23821 | /* |
| 23822 | ** Attempt to release up to n bytes of non-essential memory currently |
| 23823 | ** held by SQLite. An example of non-essential memory is memory used to |
| 23824 | ** cache database pages that are not currently in use. |
| 23825 | */ |
| 23826 | SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int n){ |
| 23827 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 23828 | return sqlite3PcacheReleaseMemory(n); |
| 23829 | #else |
| 23830 | /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine |
| 23831 | ** is a no-op returning zero if SQLite is not compiled with |
| @@ -23880,11 +23904,11 @@ | |
| 23880 | /* |
| 23881 | ** Deprecated external interface. It used to set an alarm callback |
| 23882 | ** that was invoked when memory usage grew too large. Now it is a |
| 23883 | ** no-op. |
| 23884 | */ |
| 23885 | SQLITE_API int SQLITE_STDCALL sqlite3_memory_alarm( |
| 23886 | void(*xCallback)(void *pArg, sqlite3_int64 used,int N), |
| 23887 | void *pArg, |
| 23888 | sqlite3_int64 iThreshold |
| 23889 | ){ |
| 23890 | (void)xCallback; |
| @@ -23896,11 +23920,11 @@ | |
| 23896 | |
| 23897 | /* |
| 23898 | ** Set the soft heap-size limit for the library. Passing a zero or |
| 23899 | ** negative value indicates no limit. |
| 23900 | */ |
| 23901 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 n){ |
| 23902 | sqlite3_int64 priorLimit; |
| 23903 | sqlite3_int64 excess; |
| 23904 | sqlite3_int64 nUsed; |
| 23905 | #ifndef SQLITE_OMIT_AUTOINIT |
| 23906 | int rc = sqlite3_initialize(); |
| @@ -23918,11 +23942,11 @@ | |
| 23918 | sqlite3_mutex_leave(mem0.mutex); |
| 23919 | excess = sqlite3_memory_used() - n; |
| 23920 | if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); |
| 23921 | return priorLimit; |
| 23922 | } |
| 23923 | SQLITE_API void SQLITE_STDCALL sqlite3_soft_heap_limit(int n){ |
| 23924 | if( n<0 ) n = 0; |
| 23925 | sqlite3_soft_heap_limit64(n); |
| 23926 | } |
| 23927 | |
| 23928 | /* |
| @@ -23987,11 +24011,11 @@ | |
| 23987 | } |
| 23988 | |
| 23989 | /* |
| 23990 | ** Return the amount of memory currently checked out. |
| 23991 | */ |
| 23992 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void){ |
| 23993 | sqlite3_int64 res, mx; |
| 23994 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0); |
| 23995 | return res; |
| 23996 | } |
| 23997 | |
| @@ -23998,11 +24022,11 @@ | |
| 23998 | /* |
| 23999 | ** Return the maximum amount of memory that has ever been |
| 24000 | ** checked out since either the beginning of this process |
| 24001 | ** or since the most recent reset. |
| 24002 | */ |
| 24003 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag){ |
| 24004 | sqlite3_int64 res, mx; |
| 24005 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag); |
| 24006 | return mx; |
| 24007 | } |
| 24008 | |
| @@ -24078,17 +24102,17 @@ | |
| 24078 | /* |
| 24079 | ** This version of the memory allocation is for use by the application. |
| 24080 | ** First make sure the memory subsystem is initialized, then do the |
| 24081 | ** allocation. |
| 24082 | */ |
| 24083 | SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int n){ |
| 24084 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24085 | if( sqlite3_initialize() ) return 0; |
| 24086 | #endif |
| 24087 | return n<=0 ? 0 : sqlite3Malloc(n); |
| 24088 | } |
| 24089 | SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64 n){ |
| 24090 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24091 | if( sqlite3_initialize() ) return 0; |
| 24092 | #endif |
| 24093 | return sqlite3Malloc(n); |
| 24094 | } |
| @@ -24227,20 +24251,20 @@ | |
| 24227 | }else{ |
| 24228 | assert( sqlite3_mutex_held(db->mutex) ); |
| 24229 | return db->lookaside.sz; |
| 24230 | } |
| 24231 | } |
| 24232 | SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void *p){ |
| 24233 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24234 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24235 | return p ? sqlite3GlobalConfig.m.xSize(p) : 0; |
| 24236 | } |
| 24237 | |
| 24238 | /* |
| 24239 | ** Free memory previously obtained from sqlite3Malloc(). |
| 24240 | */ |
| 24241 | SQLITE_API void SQLITE_STDCALL sqlite3_free(void *p){ |
| 24242 | if( p==0 ) return; /* IMP: R-49053-54554 */ |
| 24243 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24244 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24245 | if( sqlite3GlobalConfig.bMemstat ){ |
| 24246 | sqlite3_mutex_enter(mem0.mutex); |
| @@ -24345,18 +24369,18 @@ | |
| 24345 | |
| 24346 | /* |
| 24347 | ** The public interface to sqlite3Realloc. Make sure that the memory |
| 24348 | ** subsystem is initialized prior to invoking sqliteRealloc. |
| 24349 | */ |
| 24350 | SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void *pOld, int n){ |
| 24351 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24352 | if( sqlite3_initialize() ) return 0; |
| 24353 | #endif |
| 24354 | if( n<0 ) n = 0; /* IMP: R-26507-47431 */ |
| 24355 | return sqlite3Realloc(pOld, n); |
| 24356 | } |
| 24357 | SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ |
| 24358 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24359 | if( sqlite3_initialize() ) return 0; |
| 24360 | #endif |
| 24361 | return sqlite3Realloc(pOld, n); |
| 24362 | } |
| @@ -25579,11 +25603,11 @@ | |
| 25579 | |
| 25580 | /* |
| 25581 | ** Print into memory obtained from sqlite3_malloc(). Omit the internal |
| 25582 | ** %-conversion extensions. |
| 25583 | */ |
| 25584 | SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char *zFormat, va_list ap){ |
| 25585 | char *z; |
| 25586 | char zBase[SQLITE_PRINT_BUF_SIZE]; |
| 25587 | StrAccum acc; |
| 25588 | |
| 25589 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -25628,11 +25652,11 @@ | |
| 25628 | ** this without breaking compatibility, so we just have to live with the |
| 25629 | ** mistake. |
| 25630 | ** |
| 25631 | ** sqlite3_vsnprintf() is the varargs version. |
| 25632 | */ |
| 25633 | SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){ |
| 25634 | StrAccum acc; |
| 25635 | if( n<=0 ) return zBuf; |
| 25636 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 25637 | if( zBuf==0 || zFormat==0 ) { |
| 25638 | (void)SQLITE_MISUSE_BKPT; |
| @@ -26255,11 +26279,11 @@ | |
| 26255 | } sqlite3Prng; |
| 26256 | |
| 26257 | /* |
| 26258 | ** Return N random bytes. |
| 26259 | */ |
| 26260 | SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *pBuf){ |
| 26261 | unsigned char t; |
| 26262 | unsigned char *zBuf = pBuf; |
| 26263 | |
| 26264 | /* The "wsdPrng" macro will resolve to the pseudo-random number generator |
| 26265 | ** state vector. If writable static data is unsupported on the target, |
| @@ -27458,11 +27482,11 @@ | |
| 27458 | ** sqlite3_strnicmp() APIs allow applications and extensions to compare |
| 27459 | ** the contents of two buffers containing UTF-8 strings in a |
| 27460 | ** case-independent fashion, using the same definition of "case |
| 27461 | ** independence" that SQLite uses internally when comparing identifiers. |
| 27462 | */ |
| 27463 | SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *zLeft, const char *zRight){ |
| 27464 | if( zLeft==0 ){ |
| 27465 | return zRight ? -1 : 0; |
| 27466 | }else if( zRight==0 ){ |
| 27467 | return 1; |
| 27468 | } |
| @@ -27479,11 +27503,11 @@ | |
| 27479 | a++; |
| 27480 | b++; |
| 27481 | } |
| 27482 | return c; |
| 27483 | } |
| 27484 | SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ |
| 27485 | register unsigned char *a, *b; |
| 27486 | if( zLeft==0 ){ |
| 27487 | return zRight ? -1 : 0; |
| 27488 | }else if( zRight==0 ){ |
| 27489 | return 1; |
| @@ -36778,11 +36802,11 @@ | |
| 36778 | ** This routine is called once during SQLite initialization and by a |
| 36779 | ** single thread. The memory allocation and mutex subsystems have not |
| 36780 | ** necessarily been initialized when this routine is called, and so they |
| 36781 | ** should not be used. |
| 36782 | */ |
| 36783 | SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ |
| 36784 | /* |
| 36785 | ** The following macro defines an initializer for an sqlite3_vfs object. |
| 36786 | ** The name of the VFS is NAME. The pAppData is a pointer to a pointer |
| 36787 | ** to the "finder" function. (pAppData is a pointer to a pointer because |
| 36788 | ** silly C90 rules prohibit a void* from being cast to a function pointer |
| @@ -36877,11 +36901,11 @@ | |
| 36877 | ** |
| 36878 | ** Some operating systems might need to do some cleanup in this routine, |
| 36879 | ** to release dynamically allocated objects. But not on unix. |
| 36880 | ** This routine is a no-op for unix. |
| 36881 | */ |
| 36882 | SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ |
| 36883 | return SQLITE_OK; |
| 36884 | } |
| 36885 | |
| 36886 | #endif /* SQLITE_OS_UNIX */ |
| 36887 | |
| @@ -38312,11 +38336,11 @@ | |
| 38312 | ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one |
| 38313 | ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The |
| 38314 | ** "pnLargest" argument, if non-zero, will be used to return the size of the |
| 38315 | ** largest committed free block in the heap, in bytes. |
| 38316 | */ |
| 38317 | SQLITE_API int SQLITE_STDCALL sqlite3_win32_compact_heap(LPUINT pnLargest){ |
| 38318 | int rc = SQLITE_OK; |
| 38319 | UINT nLargest = 0; |
| 38320 | HANDLE hHeap; |
| 38321 | |
| 38322 | winMemAssertMagic(); |
| @@ -38352,11 +38376,11 @@ | |
| 38352 | ** If a Win32 native heap has been configured, this function will attempt to |
| 38353 | ** destroy and recreate it. If the Win32 native heap is not isolated and/or |
| 38354 | ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will |
| 38355 | ** be returned and no changes will be made to the Win32 native heap. |
| 38356 | */ |
| 38357 | SQLITE_API int SQLITE_STDCALL sqlite3_win32_reset_heap(){ |
| 38358 | int rc; |
| 38359 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 38360 | MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */ |
| 38361 | MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) |
| 38362 | MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); ) |
| @@ -38397,11 +38421,11 @@ | |
| 38397 | /* |
| 38398 | ** This function outputs the specified (ANSI) string to the Win32 debugger |
| 38399 | ** (if available). |
| 38400 | */ |
| 38401 | |
| 38402 | SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){ |
| 38403 | char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE]; |
| 38404 | int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */ |
| 38405 | if( nMin<-1 ) nMin = -1; /* all negative values become -1. */ |
| 38406 | assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE ); |
| 38407 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -38443,11 +38467,11 @@ | |
| 38443 | */ |
| 38444 | #if SQLITE_OS_WINRT |
| 38445 | static HANDLE sleepObj = NULL; |
| 38446 | #endif |
| 38447 | |
| 38448 | SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds){ |
| 38449 | #if SQLITE_OS_WINRT |
| 38450 | if ( sleepObj==NULL ){ |
| 38451 | sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET, |
| 38452 | SYNCHRONIZE); |
| 38453 | } |
| @@ -38492,11 +38516,11 @@ | |
| 38492 | |
| 38493 | /* |
| 38494 | ** This function determines if the machine is running a version of Windows |
| 38495 | ** based on the NT kernel. |
| 38496 | */ |
| 38497 | SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void){ |
| 38498 | #if SQLITE_OS_WINRT |
| 38499 | /* |
| 38500 | ** NOTE: The WinRT sub-platform is always assumed to be based on the NT |
| 38501 | ** kernel. |
| 38502 | */ |
| @@ -38880,11 +38904,11 @@ | |
| 38880 | } |
| 38881 | |
| 38882 | /* |
| 38883 | ** This is a public wrapper for the winUtf8ToUnicode() function. |
| 38884 | */ |
| 38885 | SQLITE_API LPWSTR SQLITE_STDCALL sqlite3_win32_utf8_to_unicode(const char *zText){ |
| 38886 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38887 | if( !zText ){ |
| 38888 | (void)SQLITE_MISUSE_BKPT; |
| 38889 | return 0; |
| 38890 | } |
| @@ -38896,11 +38920,11 @@ | |
| 38896 | } |
| 38897 | |
| 38898 | /* |
| 38899 | ** This is a public wrapper for the winUnicodeToUtf8() function. |
| 38900 | */ |
| 38901 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ |
| 38902 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38903 | if( !zWideText ){ |
| 38904 | (void)SQLITE_MISUSE_BKPT; |
| 38905 | return 0; |
| 38906 | } |
| @@ -38912,11 +38936,11 @@ | |
| 38912 | } |
| 38913 | |
| 38914 | /* |
| 38915 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 38916 | */ |
| 38917 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zText){ |
| 38918 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38919 | if( !zText ){ |
| 38920 | (void)SQLITE_MISUSE_BKPT; |
| 38921 | return 0; |
| 38922 | } |
| @@ -38928,11 +38952,11 @@ | |
| 38928 | } |
| 38929 | |
| 38930 | /* |
| 38931 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 38932 | */ |
| 38933 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){ |
| 38934 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38935 | if( !zText ){ |
| 38936 | (void)SQLITE_MISUSE_BKPT; |
| 38937 | return 0; |
| 38938 | } |
| @@ -38944,11 +38968,11 @@ | |
| 38944 | } |
| 38945 | |
| 38946 | /* |
| 38947 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 38948 | */ |
| 38949 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zText){ |
| 38950 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38951 | if( !zText ){ |
| 38952 | (void)SQLITE_MISUSE_BKPT; |
| 38953 | return 0; |
| 38954 | } |
| @@ -38960,11 +38984,11 @@ | |
| 38960 | } |
| 38961 | |
| 38962 | /* |
| 38963 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 38964 | */ |
| 38965 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){ |
| 38966 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38967 | if( !zText ){ |
| 38968 | (void)SQLITE_MISUSE_BKPT; |
| 38969 | return 0; |
| 38970 | } |
| @@ -38980,11 +39004,11 @@ | |
| 38980 | ** the provided arguments. The type argument must be 1 in order to set the |
| 38981 | ** data directory or 2 in order to set the temporary directory. The zValue |
| 38982 | ** argument is the name of the directory to use. The return value will be |
| 38983 | ** SQLITE_OK if successful. |
| 38984 | */ |
| 38985 | SQLITE_API int SQLITE_STDCALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){ |
| 38986 | char **ppDirectory = 0; |
| 38987 | #ifndef SQLITE_OMIT_AUTOINIT |
| 38988 | int rc = sqlite3_initialize(); |
| 38989 | if( rc ) return rc; |
| 38990 | #endif |
| @@ -42898,11 +42922,11 @@ | |
| 42898 | } |
| 42899 | |
| 42900 | /* |
| 42901 | ** Initialize and deinitialize the operating system interface. |
| 42902 | */ |
| 42903 | SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void){ |
| 42904 | static sqlite3_vfs winVfs = { |
| 42905 | 3, /* iVersion */ |
| 42906 | sizeof(winFile), /* szOsFile */ |
| 42907 | SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */ |
| 42908 | 0, /* pNext */ |
| @@ -43029,11 +43053,11 @@ | |
| 43029 | #endif |
| 43030 | |
| 43031 | return SQLITE_OK; |
| 43032 | } |
| 43033 | |
| 43034 | SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void){ |
| 43035 | #if SQLITE_OS_WINRT |
| 43036 | if( sleepObj!=NULL ){ |
| 43037 | osCloseHandle(sleepObj); |
| 43038 | sleepObj = NULL; |
| 43039 | } |
| @@ -57024,11 +57048,11 @@ | |
| 57024 | |
| 57025 | /* |
| 57026 | ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if |
| 57027 | ** p1 is older than p2 and zero if p1 and p2 are the same snapshot. |
| 57028 | */ |
| 57029 | SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){ |
| 57030 | WalIndexHdr *pHdr1 = (WalIndexHdr*)p1; |
| 57031 | WalIndexHdr *pHdr2 = (WalIndexHdr*)p2; |
| 57032 | |
| 57033 | /* aSalt[0] is a copy of the value stored in the wal file header. It |
| 57034 | ** is incremented each time the wal file is restarted. */ |
| @@ -58161,11 +58185,11 @@ | |
| 58161 | ** |
| 58162 | ** This routine has no effect on existing database connections. |
| 58163 | ** The shared cache setting effects only future calls to |
| 58164 | ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2(). |
| 58165 | */ |
| 58166 | SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int enable){ |
| 58167 | sqlite3GlobalConfig.sharedCacheEnabled = enable; |
| 58168 | return SQLITE_OK; |
| 58169 | } |
| 58170 | #endif |
| 58171 | |
| @@ -67934,11 +67958,11 @@ | |
| 67934 | ** a pointer to the new sqlite3_backup object. |
| 67935 | ** |
| 67936 | ** If an error occurs, NULL is returned and an error code and error message |
| 67937 | ** stored in database handle pDestDb. |
| 67938 | */ |
| 67939 | SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( |
| 67940 | sqlite3* pDestDb, /* Database to write to */ |
| 67941 | const char *zDestDb, /* Name of database within pDestDb */ |
| 67942 | sqlite3* pSrcDb, /* Database connection to read from */ |
| 67943 | const char *zSrcDb /* Name of database within pSrcDb */ |
| 67944 | ){ |
| @@ -68142,11 +68166,11 @@ | |
| 68142 | } |
| 68143 | |
| 68144 | /* |
| 68145 | ** Copy nPage pages from the source b-tree to the destination. |
| 68146 | */ |
| 68147 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage){ |
| 68148 | int rc; |
| 68149 | int destMode; /* Destination journal mode */ |
| 68150 | int pgszSrc = 0; /* Source page size */ |
| 68151 | int pgszDest = 0; /* Destination page size */ |
| 68152 | |
| @@ -68386,11 +68410,11 @@ | |
| 68386 | } |
| 68387 | |
| 68388 | /* |
| 68389 | ** Release all resources associated with an sqlite3_backup* handle. |
| 68390 | */ |
| 68391 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p){ |
| 68392 | sqlite3_backup **pp; /* Ptr to head of pagers backup list */ |
| 68393 | sqlite3 *pSrcDb; /* Source database connection */ |
| 68394 | int rc; /* Value to return */ |
| 68395 | |
| 68396 | /* Enter the mutexes */ |
| @@ -68438,11 +68462,11 @@ | |
| 68438 | |
| 68439 | /* |
| 68440 | ** Return the number of pages still to be backed up as of the most recent |
| 68441 | ** call to sqlite3_backup_step(). |
| 68442 | */ |
| 68443 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p){ |
| 68444 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68445 | if( p==0 ){ |
| 68446 | (void)SQLITE_MISUSE_BKPT; |
| 68447 | return 0; |
| 68448 | } |
| @@ -68452,11 +68476,11 @@ | |
| 68452 | |
| 68453 | /* |
| 68454 | ** Return the total number of pages in the source database as of the most |
| 68455 | ** recent call to sqlite3_backup_step(). |
| 68456 | */ |
| 68457 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p){ |
| 68458 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68459 | if( p==0 ){ |
| 68460 | (void)SQLITE_MISUSE_BKPT; |
| 68461 | return 0; |
| 68462 | } |
| @@ -74906,11 +74930,11 @@ | |
| 74906 | ** execution environment changes in a way that would alter the program |
| 74907 | ** that sqlite3_prepare() generates. For example, if new functions or |
| 74908 | ** collating sequences are registered or if an authorizer function is |
| 74909 | ** added or changed. |
| 74910 | */ |
| 74911 | SQLITE_API int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt *pStmt){ |
| 74912 | Vdbe *p = (Vdbe*)pStmt; |
| 74913 | return p==0 || p->expired; |
| 74914 | } |
| 74915 | #endif |
| 74916 | |
| @@ -74975,11 +74999,11 @@ | |
| 74975 | ** machine. |
| 74976 | ** |
| 74977 | ** This routine sets the error code and string returned by |
| 74978 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 74979 | */ |
| 74980 | SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt){ |
| 74981 | int rc; |
| 74982 | if( pStmt==0 ){ |
| 74983 | /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL |
| 74984 | ** pointer is a harmless no-op. */ |
| 74985 | rc = SQLITE_OK; |
| @@ -75002,11 +75026,11 @@ | |
| 75002 | ** the prior execution is returned. |
| 75003 | ** |
| 75004 | ** This routine sets the error code and string returned by |
| 75005 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 75006 | */ |
| 75007 | SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt){ |
| 75008 | int rc; |
| 75009 | if( pStmt==0 ){ |
| 75010 | rc = SQLITE_OK; |
| 75011 | }else{ |
| 75012 | Vdbe *v = (Vdbe*)pStmt; |
| @@ -75023,11 +75047,11 @@ | |
| 75023 | } |
| 75024 | |
| 75025 | /* |
| 75026 | ** Set all the parameters in the compiled SQL statement to NULL. |
| 75027 | */ |
| 75028 | SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){ |
| 75029 | int i; |
| 75030 | int rc = SQLITE_OK; |
| 75031 | Vdbe *p = (Vdbe*)pStmt; |
| 75032 | #if SQLITE_THREADSAFE |
| 75033 | sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex; |
| @@ -75047,11 +75071,11 @@ | |
| 75047 | |
| 75048 | /**************************** sqlite3_value_ ******************************* |
| 75049 | ** The following routines extract information from a Mem or sqlite3_value |
| 75050 | ** structure. |
| 75051 | */ |
| 75052 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value *pVal){ |
| 75053 | Mem *p = (Mem*)pVal; |
| 75054 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 75055 | if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){ |
| 75056 | assert( p->flags==MEM_Null && p->z==0 ); |
| 75057 | return 0; |
| @@ -75060,48 +75084,48 @@ | |
| 75060 | return p->n ? p->z : 0; |
| 75061 | }else{ |
| 75062 | return sqlite3_value_text(pVal); |
| 75063 | } |
| 75064 | } |
| 75065 | SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value *pVal){ |
| 75066 | return sqlite3ValueBytes(pVal, SQLITE_UTF8); |
| 75067 | } |
| 75068 | SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value *pVal){ |
| 75069 | return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE); |
| 75070 | } |
| 75071 | SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value *pVal){ |
| 75072 | return sqlite3VdbeRealValue((Mem*)pVal); |
| 75073 | } |
| 75074 | SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value *pVal){ |
| 75075 | return (int)sqlite3VdbeIntValue((Mem*)pVal); |
| 75076 | } |
| 75077 | SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value *pVal){ |
| 75078 | return sqlite3VdbeIntValue((Mem*)pVal); |
| 75079 | } |
| 75080 | SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value *pVal){ |
| 75081 | Mem *pMem = (Mem*)pVal; |
| 75082 | return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0); |
| 75083 | } |
| 75084 | SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value *pVal){ |
| 75085 | return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8); |
| 75086 | } |
| 75087 | #ifndef SQLITE_OMIT_UTF16 |
| 75088 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value* pVal){ |
| 75089 | return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE); |
| 75090 | } |
| 75091 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value *pVal){ |
| 75092 | return sqlite3ValueText(pVal, SQLITE_UTF16BE); |
| 75093 | } |
| 75094 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value *pVal){ |
| 75095 | return sqlite3ValueText(pVal, SQLITE_UTF16LE); |
| 75096 | } |
| 75097 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75098 | /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five |
| 75099 | ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating |
| 75100 | ** point number string BLOB NULL |
| 75101 | */ |
| 75102 | SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value* pVal){ |
| 75103 | static const u8 aType[] = { |
| 75104 | SQLITE_BLOB, /* 0x00 */ |
| 75105 | SQLITE_NULL, /* 0x01 */ |
| 75106 | SQLITE_TEXT, /* 0x02 */ |
| 75107 | SQLITE_NULL, /* 0x03 */ |
| @@ -75137,11 +75161,11 @@ | |
| 75137 | return aType[pVal->flags&MEM_AffMask]; |
| 75138 | } |
| 75139 | |
| 75140 | /* Make a copy of an sqlite3_value object |
| 75141 | */ |
| 75142 | SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value *pOrig){ |
| 75143 | sqlite3_value *pNew; |
| 75144 | if( pOrig==0 ) return 0; |
| 75145 | pNew = sqlite3_malloc( sizeof(*pNew) ); |
| 75146 | if( pNew==0 ) return 0; |
| 75147 | memset(pNew, 0, sizeof(*pNew)); |
| @@ -75160,11 +75184,11 @@ | |
| 75160 | } |
| 75161 | |
| 75162 | /* Destroy an sqlite3_value object previously obtained from |
| 75163 | ** sqlite3_value_dup(). |
| 75164 | */ |
| 75165 | SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value *pOld){ |
| 75166 | sqlite3ValueFree(pOld); |
| 75167 | } |
| 75168 | |
| 75169 | |
| 75170 | /**************************** sqlite3_result_ ******************************* |
| @@ -75203,21 +75227,21 @@ | |
| 75203 | xDel((void*)p); |
| 75204 | } |
| 75205 | if( pCtx ) sqlite3_result_error_toobig(pCtx); |
| 75206 | return SQLITE_TOOBIG; |
| 75207 | } |
| 75208 | SQLITE_API void SQLITE_STDCALL sqlite3_result_blob( |
| 75209 | sqlite3_context *pCtx, |
| 75210 | const void *z, |
| 75211 | int n, |
| 75212 | void (*xDel)(void *) |
| 75213 | ){ |
| 75214 | assert( n>=0 ); |
| 75215 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75216 | setResultStrOrError(pCtx, z, n, 0, xDel); |
| 75217 | } |
| 75218 | SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64( |
| 75219 | sqlite3_context *pCtx, |
| 75220 | const void *z, |
| 75221 | sqlite3_uint64 n, |
| 75222 | void (*xDel)(void *) |
| 75223 | ){ |
| @@ -75227,56 +75251,56 @@ | |
| 75227 | (void)invokeValueDestructor(z, xDel, pCtx); |
| 75228 | }else{ |
| 75229 | setResultStrOrError(pCtx, z, (int)n, 0, xDel); |
| 75230 | } |
| 75231 | } |
| 75232 | SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){ |
| 75233 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75234 | sqlite3VdbeMemSetDouble(pCtx->pOut, rVal); |
| 75235 | } |
| 75236 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ |
| 75237 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75238 | pCtx->isError = SQLITE_ERROR; |
| 75239 | pCtx->fErrorOrAux = 1; |
| 75240 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT); |
| 75241 | } |
| 75242 | #ifndef SQLITE_OMIT_UTF16 |
| 75243 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ |
| 75244 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75245 | pCtx->isError = SQLITE_ERROR; |
| 75246 | pCtx->fErrorOrAux = 1; |
| 75247 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT); |
| 75248 | } |
| 75249 | #endif |
| 75250 | SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){ |
| 75251 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75252 | sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal); |
| 75253 | } |
| 75254 | SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ |
| 75255 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75256 | sqlite3VdbeMemSetInt64(pCtx->pOut, iVal); |
| 75257 | } |
| 75258 | SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context *pCtx){ |
| 75259 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75260 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75261 | } |
| 75262 | SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ |
| 75263 | Mem *pOut = pCtx->pOut; |
| 75264 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75265 | pOut->eSubtype = eSubtype & 0xff; |
| 75266 | pOut->flags |= MEM_Subtype; |
| 75267 | } |
| 75268 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text( |
| 75269 | sqlite3_context *pCtx, |
| 75270 | const char *z, |
| 75271 | int n, |
| 75272 | void (*xDel)(void *) |
| 75273 | ){ |
| 75274 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75275 | setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel); |
| 75276 | } |
| 75277 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text64( |
| 75278 | sqlite3_context *pCtx, |
| 75279 | const char *z, |
| 75280 | sqlite3_uint64 n, |
| 75281 | void (*xDel)(void *), |
| 75282 | unsigned char enc |
| @@ -75289,56 +75313,56 @@ | |
| 75289 | }else{ |
| 75290 | setResultStrOrError(pCtx, z, (int)n, enc, xDel); |
| 75291 | } |
| 75292 | } |
| 75293 | #ifndef SQLITE_OMIT_UTF16 |
| 75294 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16( |
| 75295 | sqlite3_context *pCtx, |
| 75296 | const void *z, |
| 75297 | int n, |
| 75298 | void (*xDel)(void *) |
| 75299 | ){ |
| 75300 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75301 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel); |
| 75302 | } |
| 75303 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be( |
| 75304 | sqlite3_context *pCtx, |
| 75305 | const void *z, |
| 75306 | int n, |
| 75307 | void (*xDel)(void *) |
| 75308 | ){ |
| 75309 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75310 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel); |
| 75311 | } |
| 75312 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le( |
| 75313 | sqlite3_context *pCtx, |
| 75314 | const void *z, |
| 75315 | int n, |
| 75316 | void (*xDel)(void *) |
| 75317 | ){ |
| 75318 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75319 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel); |
| 75320 | } |
| 75321 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75322 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ |
| 75323 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75324 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 75325 | } |
| 75326 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 75327 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75328 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 75329 | } |
| 75330 | SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ |
| 75331 | Mem *pOut = pCtx->pOut; |
| 75332 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75333 | if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 75334 | return SQLITE_TOOBIG; |
| 75335 | } |
| 75336 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n); |
| 75337 | return SQLITE_OK; |
| 75338 | } |
| 75339 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 75340 | pCtx->isError = errCode; |
| 75341 | pCtx->fErrorOrAux = 1; |
| 75342 | #ifdef SQLITE_DEBUG |
| 75343 | if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode; |
| 75344 | #endif |
| @@ -75347,20 +75371,20 @@ | |
| 75347 | SQLITE_UTF8, SQLITE_STATIC); |
| 75348 | } |
| 75349 | } |
| 75350 | |
| 75351 | /* Force an SQLITE_TOOBIG error. */ |
| 75352 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context *pCtx){ |
| 75353 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75354 | pCtx->isError = SQLITE_TOOBIG; |
| 75355 | pCtx->fErrorOrAux = 1; |
| 75356 | sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, |
| 75357 | SQLITE_UTF8, SQLITE_STATIC); |
| 75358 | } |
| 75359 | |
| 75360 | /* An SQLITE_NOMEM error. */ |
| 75361 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context *pCtx){ |
| 75362 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75363 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75364 | pCtx->isError = SQLITE_NOMEM_BKPT; |
| 75365 | pCtx->fErrorOrAux = 1; |
| 75366 | sqlite3OomFault(pCtx->pOut->db); |
| @@ -75528,11 +75552,11 @@ | |
| 75528 | /* |
| 75529 | ** This is the top-level implementation of sqlite3_step(). Call |
| 75530 | ** sqlite3Step() to do most of the work. If a schema error occurs, |
| 75531 | ** call sqlite3Reprepare() and try again. |
| 75532 | */ |
| 75533 | SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt *pStmt){ |
| 75534 | int rc = SQLITE_OK; /* Result from sqlite3Step() */ |
| 75535 | int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */ |
| 75536 | Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */ |
| 75537 | int cnt = 0; /* Counter to prevent infinite loop of reprepares */ |
| 75538 | sqlite3 *db; /* The database connection */ |
| @@ -75579,11 +75603,11 @@ | |
| 75579 | |
| 75580 | /* |
| 75581 | ** Extract the user data from a sqlite3_context structure and return a |
| 75582 | ** pointer to it. |
| 75583 | */ |
| 75584 | SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context *p){ |
| 75585 | assert( p && p->pFunc ); |
| 75586 | return p->pFunc->pUserData; |
| 75587 | } |
| 75588 | |
| 75589 | /* |
| @@ -75594,11 +75618,11 @@ | |
| 75594 | ** returns a copy of the pointer to the database connection (the 1st |
| 75595 | ** parameter) of the sqlite3_create_function() and |
| 75596 | ** sqlite3_create_function16() routines that originally registered the |
| 75597 | ** application defined function. |
| 75598 | */ |
| 75599 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context *p){ |
| 75600 | assert( p && p->pOut ); |
| 75601 | return p->pOut->db; |
| 75602 | } |
| 75603 | |
| 75604 | /* |
| @@ -75670,11 +75694,11 @@ | |
| 75670 | /* |
| 75671 | ** Allocate or return the aggregate context for a user function. A new |
| 75672 | ** context is allocated on the first call. Subsequent calls return the |
| 75673 | ** same context that was returned on prior calls. |
| 75674 | */ |
| 75675 | SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){ |
| 75676 | assert( p && p->pFunc && p->pFunc->xFinalize ); |
| 75677 | assert( sqlite3_mutex_held(p->pOut->db->mutex) ); |
| 75678 | testcase( nByte<0 ); |
| 75679 | if( (p->pMem->flags & MEM_Agg)==0 ){ |
| 75680 | return createAggContext(p, nByte); |
| @@ -75685,11 +75709,11 @@ | |
| 75685 | |
| 75686 | /* |
| 75687 | ** Return the auxiliary data pointer, if any, for the iArg'th argument to |
| 75688 | ** the user-function defined by pCtx. |
| 75689 | */ |
| 75690 | SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ |
| 75691 | AuxData *pAuxData; |
| 75692 | |
| 75693 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75694 | #if SQLITE_ENABLE_STAT3_OR_STAT4 |
| 75695 | if( pCtx->pVdbe==0 ) return 0; |
| @@ -75706,11 +75730,11 @@ | |
| 75706 | /* |
| 75707 | ** Set the auxiliary data pointer and delete function, for the iArg'th |
| 75708 | ** argument to the user-function defined by pCtx. Any previous value is |
| 75709 | ** deleted by calling the delete function specified when it was set. |
| 75710 | */ |
| 75711 | SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata( |
| 75712 | sqlite3_context *pCtx, |
| 75713 | int iArg, |
| 75714 | void *pAux, |
| 75715 | void (*xDelete)(void*) |
| 75716 | ){ |
| @@ -75761,29 +75785,29 @@ | |
| 75761 | ** This function is deprecated. Do not use it for new code. It is |
| 75762 | ** provide only to avoid breaking legacy code. New aggregate function |
| 75763 | ** implementations should keep their own counts within their aggregate |
| 75764 | ** context. |
| 75765 | */ |
| 75766 | SQLITE_API int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context *p){ |
| 75767 | assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize ); |
| 75768 | return p->pMem->n; |
| 75769 | } |
| 75770 | #endif |
| 75771 | |
| 75772 | /* |
| 75773 | ** Return the number of columns in the result set for the statement pStmt. |
| 75774 | */ |
| 75775 | SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt){ |
| 75776 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75777 | return pVm ? pVm->nResColumn : 0; |
| 75778 | } |
| 75779 | |
| 75780 | /* |
| 75781 | ** Return the number of values available from the current row of the |
| 75782 | ** currently executing statement pStmt. |
| 75783 | */ |
| 75784 | SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt){ |
| 75785 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75786 | if( pVm==0 || pVm->pResultSet==0 ) return 0; |
| 75787 | return pVm->nResColumn; |
| 75788 | } |
| 75789 | |
| @@ -75882,67 +75906,67 @@ | |
| 75882 | |
| 75883 | /**************************** sqlite3_column_ ******************************* |
| 75884 | ** The following routines are used to access elements of the current row |
| 75885 | ** in the result set. |
| 75886 | */ |
| 75887 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ |
| 75888 | const void *val; |
| 75889 | val = sqlite3_value_blob( columnMem(pStmt,i) ); |
| 75890 | /* Even though there is no encoding conversion, value_blob() might |
| 75891 | ** need to call malloc() to expand the result of a zeroblob() |
| 75892 | ** expression. |
| 75893 | */ |
| 75894 | columnMallocFailure(pStmt); |
| 75895 | return val; |
| 75896 | } |
| 75897 | SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ |
| 75898 | int val = sqlite3_value_bytes( columnMem(pStmt,i) ); |
| 75899 | columnMallocFailure(pStmt); |
| 75900 | return val; |
| 75901 | } |
| 75902 | SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ |
| 75903 | int val = sqlite3_value_bytes16( columnMem(pStmt,i) ); |
| 75904 | columnMallocFailure(pStmt); |
| 75905 | return val; |
| 75906 | } |
| 75907 | SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){ |
| 75908 | double val = sqlite3_value_double( columnMem(pStmt,i) ); |
| 75909 | columnMallocFailure(pStmt); |
| 75910 | return val; |
| 75911 | } |
| 75912 | SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){ |
| 75913 | int val = sqlite3_value_int( columnMem(pStmt,i) ); |
| 75914 | columnMallocFailure(pStmt); |
| 75915 | return val; |
| 75916 | } |
| 75917 | SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ |
| 75918 | sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) ); |
| 75919 | columnMallocFailure(pStmt); |
| 75920 | return val; |
| 75921 | } |
| 75922 | SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){ |
| 75923 | const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) ); |
| 75924 | columnMallocFailure(pStmt); |
| 75925 | return val; |
| 75926 | } |
| 75927 | SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){ |
| 75928 | Mem *pOut = columnMem(pStmt, i); |
| 75929 | if( pOut->flags&MEM_Static ){ |
| 75930 | pOut->flags &= ~MEM_Static; |
| 75931 | pOut->flags |= MEM_Ephem; |
| 75932 | } |
| 75933 | columnMallocFailure(pStmt); |
| 75934 | return (sqlite3_value *)pOut; |
| 75935 | } |
| 75936 | #ifndef SQLITE_OMIT_UTF16 |
| 75937 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ |
| 75938 | const void *val = sqlite3_value_text16( columnMem(pStmt,i) ); |
| 75939 | columnMallocFailure(pStmt); |
| 75940 | return val; |
| 75941 | } |
| 75942 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75943 | SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){ |
| 75944 | int iType = sqlite3_value_type( columnMem(pStmt,i) ); |
| 75945 | columnMallocFailure(pStmt); |
| 75946 | return iType; |
| 75947 | } |
| 75948 | |
| @@ -76002,16 +76026,16 @@ | |
| 76002 | |
| 76003 | /* |
| 76004 | ** Return the name of the Nth column of the result set returned by SQL |
| 76005 | ** statement pStmt. |
| 76006 | */ |
| 76007 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){ |
| 76008 | return columnName( |
| 76009 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME); |
| 76010 | } |
| 76011 | #ifndef SQLITE_OMIT_UTF16 |
| 76012 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ |
| 76013 | return columnName( |
| 76014 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME); |
| 76015 | } |
| 76016 | #endif |
| 76017 | |
| @@ -76027,16 +76051,16 @@ | |
| 76027 | #ifndef SQLITE_OMIT_DECLTYPE |
| 76028 | /* |
| 76029 | ** Return the column declaration type (if applicable) of the 'i'th column |
| 76030 | ** of the result set of SQL statement pStmt. |
| 76031 | */ |
| 76032 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ |
| 76033 | return columnName( |
| 76034 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE); |
| 76035 | } |
| 76036 | #ifndef SQLITE_OMIT_UTF16 |
| 76037 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ |
| 76038 | return columnName( |
| 76039 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE); |
| 76040 | } |
| 76041 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76042 | #endif /* SQLITE_OMIT_DECLTYPE */ |
| @@ -76045,16 +76069,16 @@ | |
| 76045 | /* |
| 76046 | ** Return the name of the database from which a result column derives. |
| 76047 | ** NULL is returned if the result column is an expression or constant or |
| 76048 | ** anything else which is not an unambiguous reference to a database column. |
| 76049 | */ |
| 76050 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ |
| 76051 | return columnName( |
| 76052 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE); |
| 76053 | } |
| 76054 | #ifndef SQLITE_OMIT_UTF16 |
| 76055 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ |
| 76056 | return columnName( |
| 76057 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE); |
| 76058 | } |
| 76059 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76060 | |
| @@ -76061,16 +76085,16 @@ | |
| 76061 | /* |
| 76062 | ** Return the name of the table from which a result column derives. |
| 76063 | ** NULL is returned if the result column is an expression or constant or |
| 76064 | ** anything else which is not an unambiguous reference to a database column. |
| 76065 | */ |
| 76066 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ |
| 76067 | return columnName( |
| 76068 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE); |
| 76069 | } |
| 76070 | #ifndef SQLITE_OMIT_UTF16 |
| 76071 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ |
| 76072 | return columnName( |
| 76073 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE); |
| 76074 | } |
| 76075 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76076 | |
| @@ -76077,16 +76101,16 @@ | |
| 76077 | /* |
| 76078 | ** Return the name of the table column from which a result column derives. |
| 76079 | ** NULL is returned if the result column is an expression or constant or |
| 76080 | ** anything else which is not an unambiguous reference to a database column. |
| 76081 | */ |
| 76082 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ |
| 76083 | return columnName( |
| 76084 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN); |
| 76085 | } |
| 76086 | #ifndef SQLITE_OMIT_UTF16 |
| 76087 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ |
| 76088 | return columnName( |
| 76089 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN); |
| 76090 | } |
| 76091 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76092 | #endif /* SQLITE_ENABLE_COLUMN_METADATA */ |
| @@ -76183,11 +76207,11 @@ | |
| 76183 | |
| 76184 | |
| 76185 | /* |
| 76186 | ** Bind a blob value to an SQL statement variable. |
| 76187 | */ |
| 76188 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob( |
| 76189 | sqlite3_stmt *pStmt, |
| 76190 | int i, |
| 76191 | const void *zData, |
| 76192 | int nData, |
| 76193 | void (*xDel)(void*) |
| @@ -76195,11 +76219,11 @@ | |
| 76195 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76196 | if( nData<0 ) return SQLITE_MISUSE_BKPT; |
| 76197 | #endif |
| 76198 | return bindText(pStmt, i, zData, nData, xDel, 0); |
| 76199 | } |
| 76200 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64( |
| 76201 | sqlite3_stmt *pStmt, |
| 76202 | int i, |
| 76203 | const void *zData, |
| 76204 | sqlite3_uint64 nData, |
| 76205 | void (*xDel)(void*) |
| @@ -76209,52 +76233,52 @@ | |
| 76209 | return invokeValueDestructor(zData, xDel, 0); |
| 76210 | }else{ |
| 76211 | return bindText(pStmt, i, zData, (int)nData, xDel, 0); |
| 76212 | } |
| 76213 | } |
| 76214 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ |
| 76215 | int rc; |
| 76216 | Vdbe *p = (Vdbe *)pStmt; |
| 76217 | rc = vdbeUnbind(p, i); |
| 76218 | if( rc==SQLITE_OK ){ |
| 76219 | sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue); |
| 76220 | sqlite3_mutex_leave(p->db->mutex); |
| 76221 | } |
| 76222 | return rc; |
| 76223 | } |
| 76224 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ |
| 76225 | return sqlite3_bind_int64(p, i, (i64)iValue); |
| 76226 | } |
| 76227 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ |
| 76228 | int rc; |
| 76229 | Vdbe *p = (Vdbe *)pStmt; |
| 76230 | rc = vdbeUnbind(p, i); |
| 76231 | if( rc==SQLITE_OK ){ |
| 76232 | sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue); |
| 76233 | sqlite3_mutex_leave(p->db->mutex); |
| 76234 | } |
| 76235 | return rc; |
| 76236 | } |
| 76237 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){ |
| 76238 | int rc; |
| 76239 | Vdbe *p = (Vdbe*)pStmt; |
| 76240 | rc = vdbeUnbind(p, i); |
| 76241 | if( rc==SQLITE_OK ){ |
| 76242 | sqlite3_mutex_leave(p->db->mutex); |
| 76243 | } |
| 76244 | return rc; |
| 76245 | } |
| 76246 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text( |
| 76247 | sqlite3_stmt *pStmt, |
| 76248 | int i, |
| 76249 | const char *zData, |
| 76250 | int nData, |
| 76251 | void (*xDel)(void*) |
| 76252 | ){ |
| 76253 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); |
| 76254 | } |
| 76255 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64( |
| 76256 | sqlite3_stmt *pStmt, |
| 76257 | int i, |
| 76258 | const char *zData, |
| 76259 | sqlite3_uint64 nData, |
| 76260 | void (*xDel)(void*), |
| @@ -76267,21 +76291,21 @@ | |
| 76267 | if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
| 76268 | return bindText(pStmt, i, zData, (int)nData, xDel, enc); |
| 76269 | } |
| 76270 | } |
| 76271 | #ifndef SQLITE_OMIT_UTF16 |
| 76272 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16( |
| 76273 | sqlite3_stmt *pStmt, |
| 76274 | int i, |
| 76275 | const void *zData, |
| 76276 | int nData, |
| 76277 | void (*xDel)(void*) |
| 76278 | ){ |
| 76279 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); |
| 76280 | } |
| 76281 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76282 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ |
| 76283 | int rc; |
| 76284 | switch( sqlite3_value_type((sqlite3_value*)pValue) ){ |
| 76285 | case SQLITE_INTEGER: { |
| 76286 | rc = sqlite3_bind_int64(pStmt, i, pValue->u.i); |
| 76287 | break; |
| @@ -76308,21 +76332,21 @@ | |
| 76308 | break; |
| 76309 | } |
| 76310 | } |
| 76311 | return rc; |
| 76312 | } |
| 76313 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){ |
| 76314 | int rc; |
| 76315 | Vdbe *p = (Vdbe *)pStmt; |
| 76316 | rc = vdbeUnbind(p, i); |
| 76317 | if( rc==SQLITE_OK ){ |
| 76318 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 76319 | sqlite3_mutex_leave(p->db->mutex); |
| 76320 | } |
| 76321 | return rc; |
| 76322 | } |
| 76323 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ |
| 76324 | int rc; |
| 76325 | Vdbe *p = (Vdbe *)pStmt; |
| 76326 | sqlite3_mutex_enter(p->db->mutex); |
| 76327 | if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 76328 | rc = SQLITE_TOOBIG; |
| @@ -76337,11 +76361,11 @@ | |
| 76337 | |
| 76338 | /* |
| 76339 | ** Return the number of wildcards that can be potentially bound to. |
| 76340 | ** This routine is added to support DBD::SQLite. |
| 76341 | */ |
| 76342 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ |
| 76343 | Vdbe *p = (Vdbe*)pStmt; |
| 76344 | return p ? p->nVar : 0; |
| 76345 | } |
| 76346 | |
| 76347 | /* |
| @@ -76348,11 +76372,11 @@ | |
| 76348 | ** Return the name of a wildcard parameter. Return NULL if the index |
| 76349 | ** is out of range or if the wildcard is unnamed. |
| 76350 | ** |
| 76351 | ** The result is always UTF-8. |
| 76352 | */ |
| 76353 | SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ |
| 76354 | Vdbe *p = (Vdbe*)pStmt; |
| 76355 | if( p==0 || i<1 || i>p->nzVar ){ |
| 76356 | return 0; |
| 76357 | } |
| 76358 | return p->azVar[i-1]; |
| @@ -76376,11 +76400,11 @@ | |
| 76376 | } |
| 76377 | } |
| 76378 | } |
| 76379 | return 0; |
| 76380 | } |
| 76381 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ |
| 76382 | return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName)); |
| 76383 | } |
| 76384 | |
| 76385 | /* |
| 76386 | ** Transfer all bindings from the first statement over to the second. |
| @@ -76410,11 +76434,11 @@ | |
| 76410 | ** |
| 76411 | ** If the two statements contain a different number of bindings, then |
| 76412 | ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise |
| 76413 | ** SQLITE_OK is returned. |
| 76414 | */ |
| 76415 | SQLITE_API int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ |
| 76416 | Vdbe *pFrom = (Vdbe*)pFromStmt; |
| 76417 | Vdbe *pTo = (Vdbe*)pToStmt; |
| 76418 | if( pFrom->nVar!=pTo->nVar ){ |
| 76419 | return SQLITE_ERROR; |
| 76420 | } |
| @@ -76432,26 +76456,26 @@ | |
| 76432 | ** Return the sqlite3* database handle to which the prepared statement given |
| 76433 | ** in the argument belongs. This is the same database handle that was |
| 76434 | ** the first argument to the sqlite3_prepare() that was used to create |
| 76435 | ** the statement in the first place. |
| 76436 | */ |
| 76437 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt *pStmt){ |
| 76438 | return pStmt ? ((Vdbe*)pStmt)->db : 0; |
| 76439 | } |
| 76440 | |
| 76441 | /* |
| 76442 | ** Return true if the prepared statement is guaranteed to not modify the |
| 76443 | ** database. |
| 76444 | */ |
| 76445 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){ |
| 76446 | return pStmt ? ((Vdbe*)pStmt)->readOnly : 1; |
| 76447 | } |
| 76448 | |
| 76449 | /* |
| 76450 | ** Return true if the prepared statement is in need of being reset. |
| 76451 | */ |
| 76452 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){ |
| 76453 | Vdbe *v = (Vdbe*)pStmt; |
| 76454 | return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN; |
| 76455 | } |
| 76456 | |
| 76457 | /* |
| @@ -76458,11 +76482,11 @@ | |
| 76458 | ** Return a pointer to the next prepared statement after pStmt associated |
| 76459 | ** with database connection pDb. If pStmt is NULL, return the first |
| 76460 | ** prepared statement for the database connection. Return NULL if there |
| 76461 | ** are no more. |
| 76462 | */ |
| 76463 | SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){ |
| 76464 | sqlite3_stmt *pNext; |
| 76465 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76466 | if( !sqlite3SafetyCheckOk(pDb) ){ |
| 76467 | (void)SQLITE_MISUSE_BKPT; |
| 76468 | return 0; |
| @@ -76479,11 +76503,11 @@ | |
| 76479 | } |
| 76480 | |
| 76481 | /* |
| 76482 | ** Return the value of a status counter for a prepared statement |
| 76483 | */ |
| 76484 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ |
| 76485 | Vdbe *pVdbe = (Vdbe*)pStmt; |
| 76486 | u32 v; |
| 76487 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76488 | if( !pStmt ){ |
| 76489 | (void)SQLITE_MISUSE_BKPT; |
| @@ -76496,11 +76520,11 @@ | |
| 76496 | } |
| 76497 | |
| 76498 | /* |
| 76499 | ** Return the SQL associated with a prepared statement |
| 76500 | */ |
| 76501 | SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt){ |
| 76502 | Vdbe *p = (Vdbe *)pStmt; |
| 76503 | return p ? p->zSql : 0; |
| 76504 | } |
| 76505 | |
| 76506 | /* |
| @@ -76510,11 +76534,11 @@ | |
| 76510 | ** freeing the returned string by passing it to sqlite3_free(). |
| 76511 | ** |
| 76512 | ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of |
| 76513 | ** expanded bound parameters. |
| 76514 | */ |
| 76515 | SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){ |
| 76516 | #ifdef SQLITE_OMIT_TRACE |
| 76517 | return 0; |
| 76518 | #else |
| 76519 | char *z = 0; |
| 76520 | const char *zSql = sqlite3_sql(pStmt); |
| @@ -76552,11 +76576,11 @@ | |
| 76552 | |
| 76553 | /* |
| 76554 | ** This function is called from within a pre-update callback to retrieve |
| 76555 | ** a field of the row currently being updated or deleted. |
| 76556 | */ |
| 76557 | SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76558 | PreUpdate *p = db->pPreUpdate; |
| 76559 | int rc = SQLITE_OK; |
| 76560 | |
| 76561 | /* Test that this call is being made from within an SQLITE_DELETE or |
| 76562 | ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ |
| @@ -76607,11 +76631,11 @@ | |
| 76607 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76608 | /* |
| 76609 | ** This function is called from within a pre-update callback to retrieve |
| 76610 | ** the number of columns in the row being updated, deleted or inserted. |
| 76611 | */ |
| 76612 | SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *db){ |
| 76613 | PreUpdate *p = db->pPreUpdate; |
| 76614 | return (p ? p->keyinfo.nField : 0); |
| 76615 | } |
| 76616 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76617 | |
| @@ -76625,11 +76649,11 @@ | |
| 76625 | ** top-level trigger etc.). |
| 76626 | ** |
| 76627 | ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL |
| 76628 | ** or SET DEFAULT action is considered a trigger. |
| 76629 | */ |
| 76630 | SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *db){ |
| 76631 | PreUpdate *p = db->pPreUpdate; |
| 76632 | return (p ? p->v->nFrame : 0); |
| 76633 | } |
| 76634 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76635 | |
| @@ -76636,11 +76660,11 @@ | |
| 76636 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76637 | /* |
| 76638 | ** This function is called from within a pre-update callback to retrieve |
| 76639 | ** a field of the row currently being updated or inserted. |
| 76640 | */ |
| 76641 | SQLITE_API int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76642 | PreUpdate *p = db->pPreUpdate; |
| 76643 | int rc = SQLITE_OK; |
| 76644 | Mem *pMem; |
| 76645 | |
| 76646 | if( !p || p->op==SQLITE_DELETE ){ |
| @@ -76710,11 +76734,11 @@ | |
| 76710 | |
| 76711 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 76712 | /* |
| 76713 | ** Return status data for a single loop within query pStmt. |
| 76714 | */ |
| 76715 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( |
| 76716 | sqlite3_stmt *pStmt, /* Prepared statement being queried */ |
| 76717 | int idx, /* Index of loop to report on */ |
| 76718 | int iScanStatusOp, /* Which metric to return */ |
| 76719 | void *pOut /* OUT: Write the answer here */ |
| 76720 | ){ |
| @@ -76769,11 +76793,11 @@ | |
| 76769 | } |
| 76770 | |
| 76771 | /* |
| 76772 | ** Zero all counters associated with the sqlite3_stmt_scanstatus() data. |
| 76773 | */ |
| 76774 | SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){ |
| 76775 | Vdbe *p = (Vdbe*)pStmt; |
| 76776 | memset(p->anExec, 0, p->nOp * sizeof(i64)); |
| 76777 | } |
| 76778 | #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */ |
| 76779 | |
| @@ -77296,11 +77320,11 @@ | |
| 77296 | ** Try to convert the type of a function argument or a result column |
| 77297 | ** into a numeric representation. Use either INTEGER or REAL whichever |
| 77298 | ** is appropriate. But only do the conversion if it is possible without |
| 77299 | ** loss of information and return the revised type of the argument. |
| 77300 | */ |
| 77301 | SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value *pVal){ |
| 77302 | int eType = sqlite3_value_type(pVal); |
| 77303 | if( eType==SQLITE_TEXT ){ |
| 77304 | Mem *pMem = (Mem*)pVal; |
| 77305 | applyNumericAffinity(pMem, 0); |
| 77306 | eType = sqlite3_value_type(pVal); |
| @@ -84148,11 +84172,11 @@ | |
| 84148 | } |
| 84149 | |
| 84150 | /* |
| 84151 | ** Open a blob handle. |
| 84152 | */ |
| 84153 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( |
| 84154 | sqlite3* db, /* The database connection */ |
| 84155 | const char *zDb, /* The attached database containing the blob */ |
| 84156 | const char *zTable, /* The table containing the blob */ |
| 84157 | const char *zColumn, /* The column containing the blob */ |
| 84158 | sqlite_int64 iRow, /* The row containing the glob */ |
| @@ -84389,11 +84413,11 @@ | |
| 84389 | |
| 84390 | /* |
| 84391 | ** Close a blob handle that was previously created using |
| 84392 | ** sqlite3_blob_open(). |
| 84393 | */ |
| 84394 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *pBlob){ |
| 84395 | Incrblob *p = (Incrblob *)pBlob; |
| 84396 | int rc; |
| 84397 | sqlite3 *db; |
| 84398 | |
| 84399 | if( p ){ |
| @@ -84482,28 +84506,28 @@ | |
| 84482 | } |
| 84483 | |
| 84484 | /* |
| 84485 | ** Read data from a blob handle. |
| 84486 | */ |
| 84487 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ |
| 84488 | return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData); |
| 84489 | } |
| 84490 | |
| 84491 | /* |
| 84492 | ** Write data to a blob handle. |
| 84493 | */ |
| 84494 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){ |
| 84495 | return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData); |
| 84496 | } |
| 84497 | |
| 84498 | /* |
| 84499 | ** Query a blob handle for the size of the data. |
| 84500 | ** |
| 84501 | ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob |
| 84502 | ** so no mutex is required for access. |
| 84503 | */ |
| 84504 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *pBlob){ |
| 84505 | Incrblob *p = (Incrblob *)pBlob; |
| 84506 | return (p && p->pStmt) ? p->nByte : 0; |
| 84507 | } |
| 84508 | |
| 84509 | /* |
| @@ -84514,11 +84538,11 @@ | |
| 84514 | ** contain a blob or text value, then an error code is returned and the |
| 84515 | ** database handle error code and message set. If this happens, then all |
| 84516 | ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) |
| 84517 | ** immediately return SQLITE_ABORT. |
| 84518 | */ |
| 84519 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ |
| 84520 | int rc; |
| 84521 | Incrblob *p = (Incrblob *)pBlob; |
| 84522 | sqlite3 *db; |
| 84523 | |
| 84524 | if( p==0 ) return SQLITE_MISUSE_BKPT; |
| @@ -97118,11 +97142,11 @@ | |
| 97118 | ** and attempts to write the column will be ignored. |
| 97119 | ** |
| 97120 | ** Setting the auth function to NULL disables this hook. The default |
| 97121 | ** setting of the auth function is NULL. |
| 97122 | */ |
| 97123 | SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( |
| 97124 | sqlite3 *db, |
| 97125 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 97126 | void *pArg |
| 97127 | ){ |
| 97128 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -97162,10 +97186,11 @@ | |
| 97162 | ){ |
| 97163 | sqlite3 *db = pParse->db; /* Database handle */ |
| 97164 | char *zDb = db->aDb[iDb].zName; /* Name of attached database */ |
| 97165 | int rc; /* Auth callback return code */ |
| 97166 | |
| 97167 | rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext |
| 97168 | #ifdef SQLITE_USER_AUTHENTICATION |
| 97169 | ,db->auth.zAuthUser |
| 97170 | #endif |
| 97171 | ); |
| @@ -103880,18 +103905,18 @@ | |
| 103880 | } |
| 103881 | |
| 103882 | /* |
| 103883 | ** The sqlite3_strglob() interface. |
| 103884 | */ |
| 103885 | SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlobPattern, const char *zString){ |
| 103886 | return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0; |
| 103887 | } |
| 103888 | |
| 103889 | /* |
| 103890 | ** The sqlite3_strlike() interface. |
| 103891 | */ |
| 103892 | SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){ |
| 103893 | return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0; |
| 103894 | } |
| 103895 | |
| 103896 | /* |
| 103897 | ** Count the number of times that the LIKE operator (or GLOB which is |
| @@ -108583,11 +108608,11 @@ | |
| 108583 | ** If the SQL is a query, then for each row in the query result |
| 108584 | ** the xCallback() function is called. pArg becomes the first |
| 108585 | ** argument to xCallback(). If xCallback=NULL then no callback |
| 108586 | ** is invoked, even for queries. |
| 108587 | */ |
| 108588 | SQLITE_API int SQLITE_STDCALL sqlite3_exec( |
| 108589 | sqlite3 *db, /* The database on which the SQL executes */ |
| 108590 | const char *zSql, /* The SQL to be executed */ |
| 108591 | sqlite3_callback xCallback, /* Invoke this callback routine */ |
| 108592 | void *pArg, /* First argument to xCallback() */ |
| 108593 | char **pzErrMsg /* Write error messages here */ |
| @@ -108974,16 +108999,17 @@ | |
| 108974 | sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64); |
| 108975 | const char *(*uri_parameter)(const char*,const char*); |
| 108976 | char *(*vsnprintf)(int,char*,const char*,va_list); |
| 108977 | int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*); |
| 108978 | /* Version 3.8.7 and later */ |
| 108979 | int (*auto_extension)(void(*)(void)); |
| 108980 | int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64, |
| 108981 | void(*)(void*)); |
| 108982 | int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64, |
| 108983 | void(*)(void*),unsigned char); |
| 108984 | int (*cancel_auto_extension)(void(*)(void)); |
| 108985 | int (*load_extension)(sqlite3*,const char*,const char*,char**); |
| 108986 | void *(*malloc64)(sqlite3_uint64); |
| 108987 | sqlite3_uint64 (*msize)(void*); |
| 108988 | void *(*realloc64)(void*,sqlite3_uint64); |
| 108989 | void (*reset_auto_extension)(void); |
| @@ -109008,10 +109034,20 @@ | |
| 109008 | int (*system_errno)(sqlite3*); |
| 109009 | /* Version 3.14.0 and later */ |
| 109010 | int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*); |
| 109011 | char *(*expanded_sql)(sqlite3_stmt*); |
| 109012 | }; |
| 109013 | |
| 109014 | /* |
| 109015 | ** The following macros redefine the API routines so that they are |
| 109016 | ** redirected through the global sqlite3_api structure. |
| 109017 | ** |
| @@ -109280,10 +109316,18 @@ | |
| 109280 | /************** Continuing where we left off in loadext.c ********************/ |
| 109281 | /* #include "sqliteInt.h" */ |
| 109282 | /* #include <string.h> */ |
| 109283 | |
| 109284 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 109285 | |
| 109286 | /* |
| 109287 | ** Some API routines are omitted when various features are |
| 109288 | ** excluded from a build of SQLite. Substitute a NULL pointer |
| 109289 | ** for any missing APIs. |
| @@ -109369,10 +109413,14 @@ | |
| 109369 | #define sqlite3_blob_open 0 |
| 109370 | #define sqlite3_blob_read 0 |
| 109371 | #define sqlite3_blob_write 0 |
| 109372 | #define sqlite3_blob_reopen 0 |
| 109373 | #endif |
| 109374 | |
| 109375 | /* |
| 109376 | ** The following structure contains pointers to all SQLite API routines. |
| 109377 | ** A pointer to this structure is passed into extensions when they are |
| 109378 | ** loaded so that the extension can make calls back into the SQLite |
| @@ -109675,11 +109723,14 @@ | |
| 109675 | /* Version 3.10.0 and later */ |
| 109676 | sqlite3_status64, |
| 109677 | sqlite3_strlike, |
| 109678 | sqlite3_db_cacheflush, |
| 109679 | /* Version 3.12.0 and later */ |
| 109680 | sqlite3_system_errno |
| 109681 | }; |
| 109682 | |
| 109683 | /* |
| 109684 | ** Attempt to load an SQLite extension library contained in the file |
| 109685 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| @@ -109698,11 +109749,11 @@ | |
| 109698 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 109699 | char **pzErrMsg /* Put error message here if not 0 */ |
| 109700 | ){ |
| 109701 | sqlite3_vfs *pVfs = db->pVfs; |
| 109702 | void *handle; |
| 109703 | int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*); |
| 109704 | char *zErrmsg = 0; |
| 109705 | const char *zEntry; |
| 109706 | char *zAltEntry = 0; |
| 109707 | void **aHandle; |
| 109708 | u64 nMsg = 300 + sqlite3Strlen30(zFile); |
| @@ -109757,12 +109808,11 @@ | |
| 109757 | sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); |
| 109758 | } |
| 109759 | } |
| 109760 | return SQLITE_ERROR; |
| 109761 | } |
| 109762 | xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*)) |
| 109763 | sqlite3OsDlSym(pVfs, handle, zEntry); |
| 109764 | |
| 109765 | /* If no entry point was specified and the default legacy |
| 109766 | ** entry point name "sqlite3_extension_init" was not found, then |
| 109767 | ** construct an entry point name "sqlite3_X_init" where the X is |
| 109768 | ** replaced by the lowercase value of every ASCII alphabetic |
| @@ -109790,12 +109840,11 @@ | |
| 109790 | zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c]; |
| 109791 | } |
| 109792 | } |
| 109793 | memcpy(zAltEntry+iEntry, "_init", 6); |
| 109794 | zEntry = zAltEntry; |
| 109795 | xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*)) |
| 109796 | sqlite3OsDlSym(pVfs, handle, zEntry); |
| 109797 | } |
| 109798 | if( xInit==0 ){ |
| 109799 | if( pzErrMsg ){ |
| 109800 | nMsg += sqlite3Strlen30(zEntry); |
| 109801 | *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); |
| @@ -109833,11 +109882,11 @@ | |
| 109833 | db->aExtension = aHandle; |
| 109834 | |
| 109835 | db->aExtension[db->nExtension++] = handle; |
| 109836 | return SQLITE_OK; |
| 109837 | } |
| 109838 | SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( |
| 109839 | sqlite3 *db, /* Load the extension into this database connection */ |
| 109840 | const char *zFile, /* Name of the shared library containing extension */ |
| 109841 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 109842 | char **pzErrMsg /* Put error message here if not 0 */ |
| 109843 | ){ |
| @@ -109864,11 +109913,11 @@ | |
| 109864 | |
| 109865 | /* |
| 109866 | ** Enable or disable extension loading. Extension loading is disabled by |
| 109867 | ** default so as not to open security holes in older applications. |
| 109868 | */ |
| 109869 | SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){ |
| 109870 | sqlite3_mutex_enter(db->mutex); |
| 109871 | if( onoff ){ |
| 109872 | db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc; |
| 109873 | }else{ |
| 109874 | db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc); |
| @@ -109921,11 +109970,13 @@ | |
| 109921 | |
| 109922 | /* |
| 109923 | ** Register a statically linked extension that is automatically |
| 109924 | ** loaded by every new database connection. |
| 109925 | */ |
| 109926 | SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xInit)(void)){ |
| 109927 | int rc = SQLITE_OK; |
| 109928 | #ifndef SQLITE_OMIT_AUTOINIT |
| 109929 | rc = sqlite3_initialize(); |
| 109930 | if( rc ){ |
| 109931 | return rc; |
| @@ -109937,21 +109988,21 @@ | |
| 109937 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 109938 | #endif |
| 109939 | wsdAutoextInit; |
| 109940 | sqlite3_mutex_enter(mutex); |
| 109941 | for(i=0; i<wsdAutoext.nExt; i++){ |
| 109942 | if( wsdAutoext.aExt[i]==xInit ) break; |
| 109943 | } |
| 109944 | if( i==wsdAutoext.nExt ){ |
| 109945 | u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]); |
| 109946 | void (**aNew)(void); |
| 109947 | aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte); |
| 109948 | if( aNew==0 ){ |
| 109949 | rc = SQLITE_NOMEM_BKPT; |
| 109950 | }else{ |
| 109951 | wsdAutoext.aExt = aNew; |
| 109952 | wsdAutoext.aExt[wsdAutoext.nExt] = xInit; |
| 109953 | wsdAutoext.nExt++; |
| 109954 | } |
| 109955 | } |
| 109956 | sqlite3_mutex_leave(mutex); |
| 109957 | assert( (rc&0xff)==rc ); |
| @@ -109966,20 +110017,22 @@ | |
| 109966 | ** routine is a no-op. |
| 109967 | ** |
| 109968 | ** Return 1 if xInit was found on the list and removed. Return 0 if xInit |
| 109969 | ** was not on the list. |
| 109970 | */ |
| 109971 | SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xInit)(void)){ |
| 109972 | #if SQLITE_THREADSAFE |
| 109973 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 109974 | #endif |
| 109975 | int i; |
| 109976 | int n = 0; |
| 109977 | wsdAutoextInit; |
| 109978 | sqlite3_mutex_enter(mutex); |
| 109979 | for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
| 109980 | if( wsdAutoext.aExt[i]==xInit ){ |
| 109981 | wsdAutoext.nExt--; |
| 109982 | wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt]; |
| 109983 | n++; |
| 109984 | break; |
| 109985 | } |
| @@ -109989,11 +110042,11 @@ | |
| 109989 | } |
| 109990 | |
| 109991 | /* |
| 109992 | ** Reset the automatic extension loading mechanism. |
| 109993 | */ |
| 109994 | SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void){ |
| 109995 | #ifndef SQLITE_OMIT_AUTOINIT |
| 109996 | if( sqlite3_initialize()==SQLITE_OK ) |
| 109997 | #endif |
| 109998 | { |
| 109999 | #if SQLITE_THREADSAFE |
| @@ -110015,11 +110068,11 @@ | |
| 110015 | */ |
| 110016 | SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ |
| 110017 | u32 i; |
| 110018 | int go = 1; |
| 110019 | int rc; |
| 110020 | int (*xInit)(sqlite3*,char**,const sqlite3_api_routines*); |
| 110021 | |
| 110022 | wsdAutoextInit; |
| 110023 | if( wsdAutoext.nExt==0 ){ |
| 110024 | /* Common case: early out without every having to acquire a mutex */ |
| 110025 | return; |
| @@ -110032,12 +110085,11 @@ | |
| 110032 | sqlite3_mutex_enter(mutex); |
| 110033 | if( i>=wsdAutoext.nExt ){ |
| 110034 | xInit = 0; |
| 110035 | go = 0; |
| 110036 | }else{ |
| 110037 | xInit = (int(*)(sqlite3*,char**,const sqlite3_api_routines*)) |
| 110038 | wsdAutoext.aExt[i]; |
| 110039 | } |
| 110040 | sqlite3_mutex_leave(mutex); |
| 110041 | zErrmsg = 0; |
| 110042 | if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){ |
| 110043 | sqlite3ErrorWithMsg(db, rc, |
| @@ -113251,11 +113303,11 @@ | |
| 113251 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 113252 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 113253 | ** and the statement is automatically recompiled if an schema change |
| 113254 | ** occurs. |
| 113255 | */ |
| 113256 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare( |
| 113257 | sqlite3 *db, /* Database handle. */ |
| 113258 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 113259 | int nBytes, /* Length of zSql in bytes. */ |
| 113260 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113261 | const char **pzTail /* OUT: End of parsed string */ |
| @@ -113263,11 +113315,11 @@ | |
| 113263 | int rc; |
| 113264 | rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail); |
| 113265 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 113266 | return rc; |
| 113267 | } |
| 113268 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( |
| 113269 | sqlite3 *db, /* Database handle. */ |
| 113270 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 113271 | int nBytes, /* Length of zSql in bytes. */ |
| 113272 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113273 | const char **pzTail /* OUT: End of parsed string */ |
| @@ -113339,11 +113391,11 @@ | |
| 113339 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 113340 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 113341 | ** and the statement is automatically recompiled if an schema change |
| 113342 | ** occurs. |
| 113343 | */ |
| 113344 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( |
| 113345 | sqlite3 *db, /* Database handle. */ |
| 113346 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 113347 | int nBytes, /* Length of zSql in bytes. */ |
| 113348 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113349 | const void **pzTail /* OUT: End of parsed string */ |
| @@ -113351,11 +113403,11 @@ | |
| 113351 | int rc; |
| 113352 | rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail); |
| 113353 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 113354 | return rc; |
| 113355 | } |
| 113356 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( |
| 113357 | sqlite3 *db, /* Database handle. */ |
| 113358 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 113359 | int nBytes, /* Length of zSql in bytes. */ |
| 113360 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113361 | const void **pzTail /* OUT: End of parsed string */ |
| @@ -119194,11 +119246,11 @@ | |
| 119194 | ** The result that is written to ***pazResult is held in memory obtained |
| 119195 | ** from malloc(). But the caller cannot free this memory directly. |
| 119196 | ** Instead, the entire table should be passed to sqlite3_free_table() when |
| 119197 | ** the calling procedure is finished using it. |
| 119198 | */ |
| 119199 | SQLITE_API int SQLITE_STDCALL sqlite3_get_table( |
| 119200 | sqlite3 *db, /* The database on which the SQL executes */ |
| 119201 | const char *zSql, /* The SQL to be executed */ |
| 119202 | char ***pazResult, /* Write the result table here */ |
| 119203 | int *pnRow, /* Write the number of rows in the result here */ |
| 119204 | int *pnColumn, /* Write the number of columns of result here */ |
| @@ -119263,11 +119315,11 @@ | |
| 119263 | } |
| 119264 | |
| 119265 | /* |
| 119266 | ** This routine frees the space the sqlite3_get_table() malloced. |
| 119267 | */ |
| 119268 | SQLITE_API void SQLITE_STDCALL sqlite3_free_table( |
| 119269 | char **azResult /* Result returned from sqlite3_get_table() */ |
| 119270 | ){ |
| 119271 | if( azResult ){ |
| 119272 | int i, n; |
| 119273 | azResult--; |
| @@ -121673,11 +121725,11 @@ | |
| 121673 | |
| 121674 | |
| 121675 | /* |
| 121676 | ** External API function used to create a new virtual-table module. |
| 121677 | */ |
| 121678 | SQLITE_API int SQLITE_STDCALL sqlite3_create_module( |
| 121679 | sqlite3 *db, /* Database in which module is registered */ |
| 121680 | const char *zName, /* Name assigned to this module */ |
| 121681 | const sqlite3_module *pModule, /* The definition of the module */ |
| 121682 | void *pAux /* Context pointer for xCreate/xConnect */ |
| 121683 | ){ |
| @@ -121688,11 +121740,11 @@ | |
| 121688 | } |
| 121689 | |
| 121690 | /* |
| 121691 | ** External API function used to create a new virtual-table module. |
| 121692 | */ |
| 121693 | SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( |
| 121694 | sqlite3 *db, /* Database in which module is registered */ |
| 121695 | const char *zName, /* Name assigned to this module */ |
| 121696 | const sqlite3_module *pModule, /* The definition of the module */ |
| 121697 | void *pAux, /* Context pointer for xCreate/xConnect */ |
| 121698 | void (*xDestroy)(void *) /* Module destructor function */ |
| @@ -122312,11 +122364,11 @@ | |
| 122312 | /* |
| 122313 | ** This function is used to set the schema of a virtual table. It is only |
| 122314 | ** valid to call this function from within the xCreate() or xConnect() of a |
| 122315 | ** virtual table module. |
| 122316 | */ |
| 122317 | SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ |
| 122318 | VtabCtx *pCtx; |
| 122319 | Parse *pParse; |
| 122320 | int rc = SQLITE_OK; |
| 122321 | Table *pTab; |
| 122322 | char *zErr = 0; |
| @@ -122766,11 +122818,11 @@ | |
| 122766 | ** table update operation currently in progress. |
| 122767 | ** |
| 122768 | ** The results of this routine are undefined unless it is called from |
| 122769 | ** within an xUpdate method. |
| 122770 | */ |
| 122771 | SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *db){ |
| 122772 | static const unsigned char aMap[] = { |
| 122773 | SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE |
| 122774 | }; |
| 122775 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 122776 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| @@ -129063,15 +129115,15 @@ | |
| 129063 | LogEst nIter; |
| 129064 | pNew->u.btree.nEq++; |
| 129065 | pNew->nSkip++; |
| 129066 | pNew->aLTerm[pNew->nLTerm++] = 0; |
| 129067 | pNew->wsFlags |= WHERE_SKIPSCAN; |
| 129068 | nIter = pProbe->aiRowLogEst[saved_nEq]+1 - pProbe->aiRowLogEst[saved_nEq+1]; |
| 129069 | pNew->nOut -= nIter; |
| 129070 | /* TUNING: Because uncertainties in the estimates for skip-scan queries, |
| 129071 | ** add a 1.375 fudge factor to make skip-scan slightly less likely. */ |
| 129072 | nIter += 4; |
| 129073 | whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul); |
| 129074 | pNew->nOut = saved_nOut; |
| 129075 | pNew->u.btree.nEq = saved_nEq; |
| 129076 | pNew->nSkip = saved_nSkip; |
| 129077 | pNew->wsFlags = saved_wsFlags; |
| @@ -136091,11 +136143,11 @@ | |
| 136091 | ** |
| 136092 | ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed |
| 136093 | ** to recognize the end of a trigger can be omitted. All we have to do |
| 136094 | ** is look for a semicolon that is not part of an string or comment. |
| 136095 | */ |
| 136096 | SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *zSql){ |
| 136097 | u8 state = 0; /* Current state, using numbers defined in header comment */ |
| 136098 | u8 token; /* Value of the next token */ |
| 136099 | |
| 136100 | #ifndef SQLITE_OMIT_TRIGGER |
| 136101 | /* A complex statement machine used to detect the end of a CREATE TRIGGER |
| @@ -136256,11 +136308,11 @@ | |
| 136256 | /* |
| 136257 | ** This routine is the same as the sqlite3_complete() routine described |
| 136258 | ** above, except that the parameter is required to be UTF-16 encoded, not |
| 136259 | ** UTF-8. |
| 136260 | */ |
| 136261 | SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *zSql){ |
| 136262 | sqlite3_value *pVal; |
| 136263 | char const *zSql8; |
| 136264 | int rc; |
| 136265 | |
| 136266 | #ifndef SQLITE_OMIT_AUTOINIT |
| @@ -136416,28 +136468,28 @@ | |
| 136416 | #endif |
| 136417 | |
| 136418 | /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns |
| 136419 | ** a pointer to the to the sqlite3_version[] string constant. |
| 136420 | */ |
| 136421 | SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void){ return sqlite3_version; } |
| 136422 | |
| 136423 | /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a |
| 136424 | ** pointer to a string constant whose value is the same as the |
| 136425 | ** SQLITE_SOURCE_ID C preprocessor macro. |
| 136426 | */ |
| 136427 | SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 136428 | |
| 136429 | /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function |
| 136430 | ** returns an integer equal to SQLITE_VERSION_NUMBER. |
| 136431 | */ |
| 136432 | SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } |
| 136433 | |
| 136434 | /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns |
| 136435 | ** zero if and only if SQLite was compiled with mutexing code omitted due to |
| 136436 | ** the SQLITE_THREADSAFE compile-time option being set to 0. |
| 136437 | */ |
| 136438 | SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } |
| 136439 | |
| 136440 | /* |
| 136441 | ** When compiling the test fixture or with debugging enabled (on Win32), |
| 136442 | ** this variable being set to non-zero will cause OSTRACE macros to emit |
| 136443 | ** extra diagnostic information. |
| @@ -136506,11 +136558,11 @@ | |
| 136506 | ** call by X completes. |
| 136507 | ** |
| 136508 | ** * Recursive calls to this routine from thread X return immediately |
| 136509 | ** without blocking. |
| 136510 | */ |
| 136511 | SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void){ |
| 136512 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 136513 | int rc; /* Result code */ |
| 136514 | #ifdef SQLITE_EXTRA_INIT |
| 136515 | int bRunExtraInit = 0; /* Extra initialization needed */ |
| 136516 | #endif |
| @@ -136672,11 +136724,11 @@ | |
| 136672 | ** while any part of SQLite is otherwise in use in any thread. This |
| 136673 | ** routine is not threadsafe. But it is safe to invoke this routine |
| 136674 | ** on when SQLite is already shut down. If SQLite is already shut down |
| 136675 | ** when this routine is invoked, then this routine is a harmless no-op. |
| 136676 | */ |
| 136677 | SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void){ |
| 136678 | #ifdef SQLITE_OMIT_WSD |
| 136679 | int rc = sqlite3_wsd_init(4096, 24); |
| 136680 | if( rc!=SQLITE_OK ){ |
| 136681 | return rc; |
| 136682 | } |
| @@ -137091,11 +137143,11 @@ | |
| 137091 | } |
| 137092 | |
| 137093 | /* |
| 137094 | ** Return the mutex associated with a database connection. |
| 137095 | */ |
| 137096 | SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3 *db){ |
| 137097 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137098 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137099 | (void)SQLITE_MISUSE_BKPT; |
| 137100 | return 0; |
| 137101 | } |
| @@ -137105,11 +137157,11 @@ | |
| 137105 | |
| 137106 | /* |
| 137107 | ** Free up as much memory as we can from the given database |
| 137108 | ** connection. |
| 137109 | */ |
| 137110 | SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3 *db){ |
| 137111 | int i; |
| 137112 | |
| 137113 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137114 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 137115 | #endif |
| @@ -137129,11 +137181,11 @@ | |
| 137129 | |
| 137130 | /* |
| 137131 | ** Flush any dirty pages in the pager-cache for any attached database |
| 137132 | ** to disk. |
| 137133 | */ |
| 137134 | SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3 *db){ |
| 137135 | int i; |
| 137136 | int rc = SQLITE_OK; |
| 137137 | int bSeenBusy = 0; |
| 137138 | |
| 137139 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -137279,11 +137331,11 @@ | |
| 137279 | } |
| 137280 | |
| 137281 | /* |
| 137282 | ** Return the ROWID of the most recent insert |
| 137283 | */ |
| 137284 | SQLITE_API sqlite_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3 *db){ |
| 137285 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137286 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137287 | (void)SQLITE_MISUSE_BKPT; |
| 137288 | return 0; |
| 137289 | } |
| @@ -137292,11 +137344,11 @@ | |
| 137292 | } |
| 137293 | |
| 137294 | /* |
| 137295 | ** Return the number of changes in the most recent call to sqlite3_exec(). |
| 137296 | */ |
| 137297 | SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3 *db){ |
| 137298 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137299 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137300 | (void)SQLITE_MISUSE_BKPT; |
| 137301 | return 0; |
| 137302 | } |
| @@ -137305,11 +137357,11 @@ | |
| 137305 | } |
| 137306 | |
| 137307 | /* |
| 137308 | ** Return the number of changes since the database handle was opened. |
| 137309 | */ |
| 137310 | SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3 *db){ |
| 137311 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137312 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137313 | (void)SQLITE_MISUSE_BKPT; |
| 137314 | return 0; |
| 137315 | } |
| @@ -137456,12 +137508,12 @@ | |
| 137456 | ** statements or unfinished sqlite3_backups. The sqlite3_close_v2() |
| 137457 | ** version forces the connection to become a zombie if there are |
| 137458 | ** unclosed resources, and arranges for deallocation when the last |
| 137459 | ** prepare statement or sqlite3_backup closes. |
| 137460 | */ |
| 137461 | SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); } |
| 137462 | SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); } |
| 137463 | |
| 137464 | |
| 137465 | /* |
| 137466 | ** Close the mutex on database connection db. |
| 137467 | ** |
| @@ -137864,11 +137916,11 @@ | |
| 137864 | |
| 137865 | /* |
| 137866 | ** This routine sets the busy callback for an Sqlite database to the |
| 137867 | ** given callback function with the given argument. |
| 137868 | */ |
| 137869 | SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler( |
| 137870 | sqlite3 *db, |
| 137871 | int (*xBusy)(void*,int), |
| 137872 | void *pArg |
| 137873 | ){ |
| 137874 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -137887,11 +137939,11 @@ | |
| 137887 | /* |
| 137888 | ** This routine sets the progress callback for an Sqlite database to the |
| 137889 | ** given callback function with the given argument. The progress callback will |
| 137890 | ** be invoked every nOps opcodes. |
| 137891 | */ |
| 137892 | SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler( |
| 137893 | sqlite3 *db, |
| 137894 | int nOps, |
| 137895 | int (*xProgress)(void*), |
| 137896 | void *pArg |
| 137897 | ){ |
| @@ -137918,11 +137970,11 @@ | |
| 137918 | |
| 137919 | /* |
| 137920 | ** This routine installs a default busy handler that waits for the |
| 137921 | ** specified number of milliseconds before returning 0. |
| 137922 | */ |
| 137923 | SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3 *db, int ms){ |
| 137924 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137925 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 137926 | #endif |
| 137927 | if( ms>0 ){ |
| 137928 | sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); |
| @@ -137934,11 +137986,11 @@ | |
| 137934 | } |
| 137935 | |
| 137936 | /* |
| 137937 | ** Cause any pending operation to stop at its earliest opportunity. |
| 137938 | */ |
| 137939 | SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3 *db){ |
| 137940 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137941 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137942 | (void)SQLITE_MISUSE_BKPT; |
| 137943 | return; |
| 137944 | } |
| @@ -138050,11 +138102,11 @@ | |
| 138050 | } |
| 138051 | |
| 138052 | /* |
| 138053 | ** Create new user functions. |
| 138054 | */ |
| 138055 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function( |
| 138056 | sqlite3 *db, |
| 138057 | const char *zFunc, |
| 138058 | int nArg, |
| 138059 | int enc, |
| 138060 | void *p, |
| @@ -138064,11 +138116,11 @@ | |
| 138064 | ){ |
| 138065 | return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep, |
| 138066 | xFinal, 0); |
| 138067 | } |
| 138068 | |
| 138069 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( |
| 138070 | sqlite3 *db, |
| 138071 | const char *zFunc, |
| 138072 | int nArg, |
| 138073 | int enc, |
| 138074 | void *p, |
| @@ -138107,11 +138159,11 @@ | |
| 138107 | sqlite3_mutex_leave(db->mutex); |
| 138108 | return rc; |
| 138109 | } |
| 138110 | |
| 138111 | #ifndef SQLITE_OMIT_UTF16 |
| 138112 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( |
| 138113 | sqlite3 *db, |
| 138114 | const void *zFunctionName, |
| 138115 | int nArg, |
| 138116 | int eTextRep, |
| 138117 | void *p, |
| @@ -138147,11 +138199,11 @@ | |
| 138147 | ** When virtual tables intend to provide an overloaded function, they |
| 138148 | ** should call this routine to make sure the global function exists. |
| 138149 | ** A global function must exist in order for name resolution to work |
| 138150 | ** properly. |
| 138151 | */ |
| 138152 | SQLITE_API int SQLITE_STDCALL sqlite3_overload_function( |
| 138153 | sqlite3 *db, |
| 138154 | const char *zName, |
| 138155 | int nArg |
| 138156 | ){ |
| 138157 | int rc = SQLITE_OK; |
| @@ -138179,11 +138231,11 @@ | |
| 138179 | ** A NULL trace function means that no tracing is executes. A non-NULL |
| 138180 | ** trace is a pointer to a function that is invoked at the start of each |
| 138181 | ** SQL statement. |
| 138182 | */ |
| 138183 | #ifndef SQLITE_OMIT_DEPRECATED |
| 138184 | SQLITE_API void *SQLITE_STDCALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){ |
| 138185 | void *pOld; |
| 138186 | |
| 138187 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138188 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138189 | (void)SQLITE_MISUSE_BKPT; |
| @@ -138200,11 +138252,11 @@ | |
| 138200 | } |
| 138201 | #endif /* SQLITE_OMIT_DEPRECATED */ |
| 138202 | |
| 138203 | /* Register a trace callback using the version-2 interface. |
| 138204 | */ |
| 138205 | SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( |
| 138206 | sqlite3 *db, /* Trace this connection */ |
| 138207 | unsigned mTrace, /* Mask of events to be traced */ |
| 138208 | int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */ |
| 138209 | void *pArg /* Context */ |
| 138210 | ){ |
| @@ -138228,11 +138280,11 @@ | |
| 138228 | ** |
| 138229 | ** A NULL profile function means that no profiling is executes. A non-NULL |
| 138230 | ** profile is a pointer to a function that is invoked at the conclusion of |
| 138231 | ** each SQL statement that is run. |
| 138232 | */ |
| 138233 | SQLITE_API void *SQLITE_STDCALL sqlite3_profile( |
| 138234 | sqlite3 *db, |
| 138235 | void (*xProfile)(void*,const char*,sqlite_uint64), |
| 138236 | void *pArg |
| 138237 | ){ |
| 138238 | void *pOld; |
| @@ -138256,11 +138308,11 @@ | |
| 138256 | /* |
| 138257 | ** Register a function to be invoked when a transaction commits. |
| 138258 | ** If the invoked function returns non-zero, then the commit becomes a |
| 138259 | ** rollback. |
| 138260 | */ |
| 138261 | SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook( |
| 138262 | sqlite3 *db, /* Attach the hook to this database */ |
| 138263 | int (*xCallback)(void*), /* Function to invoke on each commit */ |
| 138264 | void *pArg /* Argument to the function */ |
| 138265 | ){ |
| 138266 | void *pOld; |
| @@ -138281,11 +138333,11 @@ | |
| 138281 | |
| 138282 | /* |
| 138283 | ** Register a callback to be invoked each time a row is updated, |
| 138284 | ** inserted or deleted using this database connection. |
| 138285 | */ |
| 138286 | SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( |
| 138287 | sqlite3 *db, /* Attach the hook to this database */ |
| 138288 | void (*xCallback)(void*,int,char const *,char const *,sqlite_int64), |
| 138289 | void *pArg /* Argument to the function */ |
| 138290 | ){ |
| 138291 | void *pRet; |
| @@ -138306,11 +138358,11 @@ | |
| 138306 | |
| 138307 | /* |
| 138308 | ** Register a callback to be invoked each time a transaction is rolled |
| 138309 | ** back by this database connection. |
| 138310 | */ |
| 138311 | SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook( |
| 138312 | sqlite3 *db, /* Attach the hook to this database */ |
| 138313 | void (*xCallback)(void*), /* Callback function */ |
| 138314 | void *pArg /* Argument to the function */ |
| 138315 | ){ |
| 138316 | void *pRet; |
| @@ -138332,11 +138384,11 @@ | |
| 138332 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 138333 | /* |
| 138334 | ** Register a callback to be invoked each time a row is updated, |
| 138335 | ** inserted or deleted using this database connection. |
| 138336 | */ |
| 138337 | SQLITE_API void *SQLITE_STDCALL sqlite3_preupdate_hook( |
| 138338 | sqlite3 *db, /* Attach the hook to this database */ |
| 138339 | void(*xCallback)( /* Callback function */ |
| 138340 | void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64), |
| 138341 | void *pArg /* First callback argument */ |
| 138342 | ){ |
| @@ -138381,11 +138433,11 @@ | |
| 138381 | ** The callback registered by this function replaces any existing callback |
| 138382 | ** registered using sqlite3_wal_hook(). Likewise, registering a callback |
| 138383 | ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism |
| 138384 | ** configured by this function. |
| 138385 | */ |
| 138386 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ |
| 138387 | #ifdef SQLITE_OMIT_WAL |
| 138388 | UNUSED_PARAMETER(db); |
| 138389 | UNUSED_PARAMETER(nFrame); |
| 138390 | #else |
| 138391 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -138402,11 +138454,11 @@ | |
| 138402 | |
| 138403 | /* |
| 138404 | ** Register a callback to be invoked each time a transaction is written |
| 138405 | ** into the write-ahead-log by this database connection. |
| 138406 | */ |
| 138407 | SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( |
| 138408 | sqlite3 *db, /* Attach the hook to this db handle */ |
| 138409 | int(*xCallback)(void *, sqlite3*, const char*, int), |
| 138410 | void *pArg /* First argument passed to xCallback() */ |
| 138411 | ){ |
| 138412 | #ifndef SQLITE_OMIT_WAL |
| @@ -138429,11 +138481,11 @@ | |
| 138429 | } |
| 138430 | |
| 138431 | /* |
| 138432 | ** Checkpoint database zDb. |
| 138433 | */ |
| 138434 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( |
| 138435 | sqlite3 *db, /* Database handle */ |
| 138436 | const char *zDb, /* Name of attached database (or NULL) */ |
| 138437 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 138438 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 138439 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -138484,11 +138536,11 @@ | |
| 138484 | /* |
| 138485 | ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points |
| 138486 | ** to contains a zero-length string, all attached databases are |
| 138487 | ** checkpointed. |
| 138488 | */ |
| 138489 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ |
| 138490 | /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to |
| 138491 | ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */ |
| 138492 | return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0); |
| 138493 | } |
| 138494 | |
| @@ -138575,11 +138627,11 @@ | |
| 138575 | |
| 138576 | /* |
| 138577 | ** Return UTF-8 encoded English language explanation of the most recent |
| 138578 | ** error. |
| 138579 | */ |
| 138580 | SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3 *db){ |
| 138581 | const char *z; |
| 138582 | if( !db ){ |
| 138583 | return sqlite3ErrStr(SQLITE_NOMEM_BKPT); |
| 138584 | } |
| 138585 | if( !sqlite3SafetyCheckSickOrOk(db) ){ |
| @@ -138603,11 +138655,11 @@ | |
| 138603 | #ifndef SQLITE_OMIT_UTF16 |
| 138604 | /* |
| 138605 | ** Return UTF-16 encoded English language explanation of the most recent |
| 138606 | ** error. |
| 138607 | */ |
| 138608 | SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3 *db){ |
| 138609 | static const u16 outOfMem[] = { |
| 138610 | 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 |
| 138611 | }; |
| 138612 | static const u16 misuse[] = { |
| 138613 | 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', |
| @@ -138648,38 +138700,38 @@ | |
| 138648 | |
| 138649 | /* |
| 138650 | ** Return the most recent error code generated by an SQLite routine. If NULL is |
| 138651 | ** passed to this function, we assume a malloc() failed during sqlite3_open(). |
| 138652 | */ |
| 138653 | SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db){ |
| 138654 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 138655 | return SQLITE_MISUSE_BKPT; |
| 138656 | } |
| 138657 | if( !db || db->mallocFailed ){ |
| 138658 | return SQLITE_NOMEM_BKPT; |
| 138659 | } |
| 138660 | return db->errCode & db->errMask; |
| 138661 | } |
| 138662 | SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db){ |
| 138663 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 138664 | return SQLITE_MISUSE_BKPT; |
| 138665 | } |
| 138666 | if( !db || db->mallocFailed ){ |
| 138667 | return SQLITE_NOMEM_BKPT; |
| 138668 | } |
| 138669 | return db->errCode; |
| 138670 | } |
| 138671 | SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3 *db){ |
| 138672 | return db ? db->iSysErrno : 0; |
| 138673 | } |
| 138674 | |
| 138675 | /* |
| 138676 | ** Return a string that describes the kind of error specified in the |
| 138677 | ** argument. For now, this simply calls the internal sqlite3ErrStr() |
| 138678 | ** function. |
| 138679 | */ |
| 138680 | SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int rc){ |
| 138681 | return sqlite3ErrStr(rc); |
| 138682 | } |
| 138683 | |
| 138684 | /* |
| 138685 | ** Create a new collating function for database "db". The name is zName |
| @@ -138823,11 +138875,11 @@ | |
| 138823 | ** |
| 138824 | ** A new lower limit does not shrink existing constructs. |
| 138825 | ** It merely prevents new constructs that exceed the limit |
| 138826 | ** from forming. |
| 138827 | */ |
| 138828 | SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ |
| 138829 | int oldLimit; |
| 138830 | |
| 138831 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138832 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138833 | (void)SQLITE_MISUSE_BKPT; |
| @@ -139447,18 +139499,18 @@ | |
| 139447 | } |
| 139448 | |
| 139449 | /* |
| 139450 | ** Open a new database handle. |
| 139451 | */ |
| 139452 | SQLITE_API int SQLITE_STDCALL sqlite3_open( |
| 139453 | const char *zFilename, |
| 139454 | sqlite3 **ppDb |
| 139455 | ){ |
| 139456 | return openDatabase(zFilename, ppDb, |
| 139457 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); |
| 139458 | } |
| 139459 | SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( |
| 139460 | const char *filename, /* Database filename (UTF-8) */ |
| 139461 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 139462 | int flags, /* Flags */ |
| 139463 | const char *zVfs /* Name of VFS module to use */ |
| 139464 | ){ |
| @@ -139467,11 +139519,11 @@ | |
| 139467 | |
| 139468 | #ifndef SQLITE_OMIT_UTF16 |
| 139469 | /* |
| 139470 | ** Open a new database handle. |
| 139471 | */ |
| 139472 | SQLITE_API int SQLITE_STDCALL sqlite3_open16( |
| 139473 | const void *zFilename, |
| 139474 | sqlite3 **ppDb |
| 139475 | ){ |
| 139476 | char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ |
| 139477 | sqlite3_value *pVal; |
| @@ -139506,11 +139558,11 @@ | |
| 139506 | #endif /* SQLITE_OMIT_UTF16 */ |
| 139507 | |
| 139508 | /* |
| 139509 | ** Register a new collation sequence with the database handle db. |
| 139510 | */ |
| 139511 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( |
| 139512 | sqlite3* db, |
| 139513 | const char *zName, |
| 139514 | int enc, |
| 139515 | void* pCtx, |
| 139516 | int(*xCompare)(void*,int,const void*,int,const void*) |
| @@ -139519,11 +139571,11 @@ | |
| 139519 | } |
| 139520 | |
| 139521 | /* |
| 139522 | ** Register a new collation sequence with the database handle db. |
| 139523 | */ |
| 139524 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( |
| 139525 | sqlite3* db, |
| 139526 | const char *zName, |
| 139527 | int enc, |
| 139528 | void* pCtx, |
| 139529 | int(*xCompare)(void*,int,const void*,int,const void*), |
| @@ -139544,11 +139596,11 @@ | |
| 139544 | |
| 139545 | #ifndef SQLITE_OMIT_UTF16 |
| 139546 | /* |
| 139547 | ** Register a new collation sequence with the database handle db. |
| 139548 | */ |
| 139549 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( |
| 139550 | sqlite3* db, |
| 139551 | const void *zName, |
| 139552 | int enc, |
| 139553 | void* pCtx, |
| 139554 | int(*xCompare)(void*,int,const void*,int,const void*) |
| @@ -139574,11 +139626,11 @@ | |
| 139574 | |
| 139575 | /* |
| 139576 | ** Register a collation sequence factory callback with the database handle |
| 139577 | ** db. Replace any previously installed collation sequence factory. |
| 139578 | */ |
| 139579 | SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( |
| 139580 | sqlite3 *db, |
| 139581 | void *pCollNeededArg, |
| 139582 | void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) |
| 139583 | ){ |
| 139584 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -139595,11 +139647,11 @@ | |
| 139595 | #ifndef SQLITE_OMIT_UTF16 |
| 139596 | /* |
| 139597 | ** Register a collation sequence factory callback with the database handle |
| 139598 | ** db. Replace any previously installed collation sequence factory. |
| 139599 | */ |
| 139600 | SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( |
| 139601 | sqlite3 *db, |
| 139602 | void *pCollNeededArg, |
| 139603 | void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) |
| 139604 | ){ |
| 139605 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -139617,11 +139669,11 @@ | |
| 139617 | #ifndef SQLITE_OMIT_DEPRECATED |
| 139618 | /* |
| 139619 | ** This function is now an anachronism. It used to be used to recover from a |
| 139620 | ** malloc() failure, but SQLite now does this automatically. |
| 139621 | */ |
| 139622 | SQLITE_API int SQLITE_STDCALL sqlite3_global_recover(void){ |
| 139623 | return SQLITE_OK; |
| 139624 | } |
| 139625 | #endif |
| 139626 | |
| 139627 | /* |
| @@ -139628,11 +139680,11 @@ | |
| 139628 | ** Test to see whether or not the database connection is in autocommit |
| 139629 | ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on |
| 139630 | ** by default. Autocommit is disabled by a BEGIN statement and reenabled |
| 139631 | ** by the next COMMIT or ROLLBACK. |
| 139632 | */ |
| 139633 | SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3 *db){ |
| 139634 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139635 | if( !sqlite3SafetyCheckOk(db) ){ |
| 139636 | (void)SQLITE_MISUSE_BKPT; |
| 139637 | return 0; |
| 139638 | } |
| @@ -139685,19 +139737,19 @@ | |
| 139685 | ** data for this thread has been deallocated. |
| 139686 | ** |
| 139687 | ** SQLite no longer uses thread-specific data so this routine is now a |
| 139688 | ** no-op. It is retained for historical compatibility. |
| 139689 | */ |
| 139690 | SQLITE_API void SQLITE_STDCALL sqlite3_thread_cleanup(void){ |
| 139691 | } |
| 139692 | #endif |
| 139693 | |
| 139694 | /* |
| 139695 | ** Return meta information about a specific column of a database table. |
| 139696 | ** See comment in sqlite3.h (sqlite.h.in) for details. |
| 139697 | */ |
| 139698 | SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( |
| 139699 | sqlite3 *db, /* Connection handle */ |
| 139700 | const char *zDbName, /* Database name or NULL */ |
| 139701 | const char *zTableName, /* Table name */ |
| 139702 | const char *zColumnName, /* Column name */ |
| 139703 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -139811,11 +139863,11 @@ | |
| 139811 | } |
| 139812 | |
| 139813 | /* |
| 139814 | ** Sleep for a little while. Return the amount of time slept. |
| 139815 | */ |
| 139816 | SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int ms){ |
| 139817 | sqlite3_vfs *pVfs; |
| 139818 | int rc; |
| 139819 | pVfs = sqlite3_vfs_find(0); |
| 139820 | if( pVfs==0 ) return 0; |
| 139821 | |
| @@ -139827,11 +139879,11 @@ | |
| 139827 | } |
| 139828 | |
| 139829 | /* |
| 139830 | ** Enable or disable the extended result codes. |
| 139831 | */ |
| 139832 | SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){ |
| 139833 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139834 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 139835 | #endif |
| 139836 | sqlite3_mutex_enter(db->mutex); |
| 139837 | db->errMask = onoff ? 0xffffffff : 0xff; |
| @@ -139840,11 +139892,11 @@ | |
| 139840 | } |
| 139841 | |
| 139842 | /* |
| 139843 | ** Invoke the xFileControl method on a particular database. |
| 139844 | */ |
| 139845 | SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ |
| 139846 | int rc = SQLITE_ERROR; |
| 139847 | Btree *pBtree; |
| 139848 | |
| 139849 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139850 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| @@ -140225,11 +140277,11 @@ | |
| 140225 | ** method of a VFS implementation. The zParam argument is the name of the |
| 140226 | ** query parameter we seek. This routine returns the value of the zParam |
| 140227 | ** parameter if it exists. If the parameter does not exist, this routine |
| 140228 | ** returns a NULL pointer. |
| 140229 | */ |
| 140230 | SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 140231 | if( zFilename==0 || zParam==0 ) return 0; |
| 140232 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 140233 | while( zFilename[0] ){ |
| 140234 | int x = strcmp(zFilename, zParam); |
| 140235 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| @@ -140240,20 +140292,20 @@ | |
| 140240 | } |
| 140241 | |
| 140242 | /* |
| 140243 | ** Return a boolean value for a query parameter. |
| 140244 | */ |
| 140245 | SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ |
| 140246 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| 140247 | bDflt = bDflt!=0; |
| 140248 | return z ? sqlite3GetBoolean(z, bDflt) : bDflt; |
| 140249 | } |
| 140250 | |
| 140251 | /* |
| 140252 | ** Return a 64-bit integer value for a query parameter. |
| 140253 | */ |
| 140254 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64( |
| 140255 | const char *zFilename, /* Filename as passed to xOpen */ |
| 140256 | const char *zParam, /* URI parameter sought */ |
| 140257 | sqlite3_int64 bDflt /* return if parameter is missing */ |
| 140258 | ){ |
| 140259 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| @@ -140281,11 +140333,11 @@ | |
| 140281 | |
| 140282 | /* |
| 140283 | ** Return the filename of the database associated with a database |
| 140284 | ** connection. |
| 140285 | */ |
| 140286 | SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){ |
| 140287 | Btree *pBt; |
| 140288 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140289 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140290 | (void)SQLITE_MISUSE_BKPT; |
| 140291 | return 0; |
| @@ -140297,11 +140349,11 @@ | |
| 140297 | |
| 140298 | /* |
| 140299 | ** Return 1 if database is read-only or 0 if read/write. Return -1 if |
| 140300 | ** no such database exists. |
| 140301 | */ |
| 140302 | SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ |
| 140303 | Btree *pBt; |
| 140304 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140305 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140306 | (void)SQLITE_MISUSE_BKPT; |
| 140307 | return -1; |
| @@ -140314,11 +140366,11 @@ | |
| 140314 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 140315 | /* |
| 140316 | ** Obtain a snapshot handle for the snapshot of database zDb currently |
| 140317 | ** being read by handle db. |
| 140318 | */ |
| 140319 | SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_get( |
| 140320 | sqlite3 *db, |
| 140321 | const char *zDb, |
| 140322 | sqlite3_snapshot **ppSnapshot |
| 140323 | ){ |
| 140324 | int rc = SQLITE_ERROR; |
| @@ -140349,11 +140401,11 @@ | |
| 140349 | } |
| 140350 | |
| 140351 | /* |
| 140352 | ** Open a read-transaction on the snapshot idendified by pSnapshot. |
| 140353 | */ |
| 140354 | SQLITE_API int SQLITE_STDCALL sqlite3_snapshot_open( |
| 140355 | sqlite3 *db, |
| 140356 | const char *zDb, |
| 140357 | sqlite3_snapshot *pSnapshot |
| 140358 | ){ |
| 140359 | int rc = SQLITE_ERROR; |
| @@ -140386,11 +140438,11 @@ | |
| 140386 | } |
| 140387 | |
| 140388 | /* |
| 140389 | ** Free a snapshot handle obtained from sqlite3_snapshot_get(). |
| 140390 | */ |
| 140391 | SQLITE_API void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){ |
| 140392 | sqlite3_free(pSnapshot); |
| 140393 | } |
| 140394 | #endif /* SQLITE_ENABLE_SNAPSHOT */ |
| 140395 | |
| 140396 | /************** End of main.c ************************************************/ |
| @@ -140540,11 +140592,11 @@ | |
| 140540 | ** |
| 140541 | ** Each call to this routine overrides any prior callbacks registered |
| 140542 | ** on the same "db". If xNotify==0 then any prior callbacks are immediately |
| 140543 | ** cancelled. |
| 140544 | */ |
| 140545 | SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( |
| 140546 | sqlite3 *db, |
| 140547 | void (*xNotify)(void **, int), |
| 140548 | void *pArg |
| 140549 | ){ |
| 140550 | int rc = SQLITE_OK; |
| @@ -147543,11 +147595,11 @@ | |
| 147543 | ** Initialize API pointer table, if required. |
| 147544 | */ |
| 147545 | #ifdef _WIN32 |
| 147546 | __declspec(dllexport) |
| 147547 | #endif |
| 147548 | SQLITE_API int SQLITE_STDCALL sqlite3_fts3_init( |
| 147549 | sqlite3 *db, |
| 147550 | char **pzErrMsg, |
| 147551 | const sqlite3_api_routines *pApi |
| 147552 | ){ |
| 147553 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -150699,11 +150751,15 @@ | |
| 150699 | } |
| 150700 | |
| 150701 | |
| 150702 | #ifdef SQLITE_TEST |
| 150703 | |
| 150704 | #include <tcl.h> |
| 150705 | /* #include <string.h> */ |
| 150706 | |
| 150707 | /* |
| 150708 | ** Implementation of a special SQL scalar function for testing tokenizers |
| 150709 | ** designed to be used in concert with the Tcl testing framework. This |
| @@ -163340,11 +163396,11 @@ | |
| 163340 | } |
| 163341 | |
| 163342 | /* |
| 163343 | ** Register a new geometry function for use with the r-tree MATCH operator. |
| 163344 | */ |
| 163345 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( |
| 163346 | sqlite3 *db, /* Register SQL function on this connection */ |
| 163347 | const char *zGeom, /* Name of the new SQL function */ |
| 163348 | int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */ |
| 163349 | void *pContext /* Extra data associated with the callback */ |
| 163350 | ){ |
| @@ -163364,11 +163420,11 @@ | |
| 163364 | |
| 163365 | /* |
| 163366 | ** Register a new 2nd-generation geometry function for use with the |
| 163367 | ** r-tree MATCH operator. |
| 163368 | */ |
| 163369 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( |
| 163370 | sqlite3 *db, /* Register SQL function on this connection */ |
| 163371 | const char *zQueryFunc, /* Name of new SQL function */ |
| 163372 | int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */ |
| 163373 | void *pContext, /* Extra data passed into the callback */ |
| 163374 | void (*xDestructor)(void*) /* Destructor for the extra data */ |
| @@ -163389,11 +163445,11 @@ | |
| 163389 | |
| 163390 | #if !SQLITE_CORE |
| 163391 | #ifdef _WIN32 |
| 163392 | __declspec(dllexport) |
| 163393 | #endif |
| 163394 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_init( |
| 163395 | sqlite3 *db, |
| 163396 | char **pzErrMsg, |
| 163397 | const sqlite3_api_routines *pApi |
| 163398 | ){ |
| 163399 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -163940,11 +163996,11 @@ | |
| 163940 | |
| 163941 | #if !SQLITE_CORE |
| 163942 | #ifdef _WIN32 |
| 163943 | __declspec(dllexport) |
| 163944 | #endif |
| 163945 | SQLITE_API int SQLITE_STDCALL sqlite3_icu_init( |
| 163946 | sqlite3 *db, |
| 163947 | char **pzErrMsg, |
| 163948 | const sqlite3_api_routines *pApi |
| 163949 | ){ |
| 163950 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -164620,11 +164676,11 @@ | |
| 164620 | ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of |
| 164621 | ** SQLite's built-in VFSs, including the multiplexor VFS. However it does |
| 164622 | ** not work out of the box with zipvfs. Refer to the comment describing |
| 164623 | ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs. |
| 164624 | */ |
| 164625 | SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open( |
| 164626 | const char *zTarget, |
| 164627 | const char *zRbu, |
| 164628 | const char *zState |
| 164629 | ); |
| 164630 | |
| @@ -164653,11 +164709,11 @@ | |
| 164653 | ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment |
| 164654 | ** describing the sqlite3rbu_create_vfs() API function below for |
| 164655 | ** a description of the complications associated with using RBU with |
| 164656 | ** zipvfs databases. |
| 164657 | */ |
| 164658 | SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum( |
| 164659 | const char *zTarget, |
| 164660 | const char *zState |
| 164661 | ); |
| 164662 | |
| 164663 | /* |
| @@ -164689,11 +164745,11 @@ | |
| 164689 | ** when sqlite3rbu_close() is called. |
| 164690 | ** |
| 164691 | ** Database handles returned by this function remain valid until the next |
| 164692 | ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db(). |
| 164693 | */ |
| 164694 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu*, int bRbu); |
| 164695 | |
| 164696 | /* |
| 164697 | ** Do some work towards applying the RBU update to the target db. |
| 164698 | ** |
| 164699 | ** Return SQLITE_DONE if the update has been completely applied, or |
| @@ -164703,11 +164759,11 @@ | |
| 164703 | ** |
| 164704 | ** Once a call to sqlite3rbu_step() has returned a value other than |
| 164705 | ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops |
| 164706 | ** that immediately return the same value. |
| 164707 | */ |
| 164708 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *pRbu); |
| 164709 | |
| 164710 | /* |
| 164711 | ** Force RBU to save its state to disk. |
| 164712 | ** |
| 164713 | ** If a power failure or application crash occurs during an update, following |
| @@ -164715,11 +164771,11 @@ | |
| 164715 | ** was last saved. In other words, from the most recent successful call to |
| 164716 | ** sqlite3rbu_close() or this function. |
| 164717 | ** |
| 164718 | ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. |
| 164719 | */ |
| 164720 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *pRbu); |
| 164721 | |
| 164722 | /* |
| 164723 | ** Close an RBU handle. |
| 164724 | ** |
| 164725 | ** If the RBU update has been completely applied, mark the RBU database |
| @@ -164735,18 +164791,18 @@ | |
| 164735 | ** |
| 164736 | ** Otherwise, if no error occurs, this function returns SQLITE_OK if the |
| 164737 | ** update has been partially applied, or SQLITE_DONE if it has been |
| 164738 | ** completely applied. |
| 164739 | */ |
| 164740 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); |
| 164741 | |
| 164742 | /* |
| 164743 | ** Return the total number of key-value operations (inserts, deletes or |
| 164744 | ** updates) that have been performed on the target database since the |
| 164745 | ** current RBU update was started. |
| 164746 | */ |
| 164747 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu); |
| 164748 | |
| 164749 | /* |
| 164750 | ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) |
| 164751 | ** progress indications for the two stages of an RBU update. This API may |
| 164752 | ** be useful for driving GUI progress indicators and similar. |
| @@ -164784,11 +164840,11 @@ | |
| 164784 | ** permyriadage progress of the same stage. If the rbu_count table does |
| 164785 | ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count |
| 164786 | ** table exists but is not correctly populated, the value of the *pnOne |
| 164787 | ** output variable during stage 1 is undefined. |
| 164788 | */ |
| 164789 | SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo); |
| 164790 | |
| 164791 | /* |
| 164792 | ** Obtain an indication as to the current stage of an RBU update or vacuum. |
| 164793 | ** This function always returns one of the SQLITE_RBU_STATE_XXX constants |
| 164794 | ** defined in this file. Return values should be interpreted as follows: |
| @@ -164822,11 +164878,11 @@ | |
| 164822 | #define SQLITE_RBU_STATE_MOVE 2 |
| 164823 | #define SQLITE_RBU_STATE_CHECKPOINT 3 |
| 164824 | #define SQLITE_RBU_STATE_DONE 4 |
| 164825 | #define SQLITE_RBU_STATE_ERROR 5 |
| 164826 | |
| 164827 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *pRbu); |
| 164828 | |
| 164829 | /* |
| 164830 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 164831 | ** via existing VFS zParent. Or, if the zParent parameter is passed NULL, |
| 164832 | ** then the new RBU VFS uses the default system VFS to access the file-system. |
| @@ -164866,21 +164922,21 @@ | |
| 164866 | ** The overhead of adding the "rbu" VFS to the system is negligible for |
| 164867 | ** non-RBU users. There is no harm in an application accessing the |
| 164868 | ** file-system via "rbu" all the time, even if it only uses RBU functionality |
| 164869 | ** occasionally. |
| 164870 | */ |
| 164871 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent); |
| 164872 | |
| 164873 | /* |
| 164874 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 164875 | ** sqlite3rbu_create_vfs(). |
| 164876 | ** |
| 164877 | ** VFS objects are not reference counted. If a VFS object is destroyed |
| 164878 | ** before all database handles that use it have been closed, the results |
| 164879 | ** are undefined. |
| 164880 | */ |
| 164881 | SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName); |
| 164882 | |
| 164883 | #if 0 |
| 164884 | } /* end of the 'extern "C"' block */ |
| 164885 | #endif |
| 164886 | |
| @@ -167970,11 +168026,11 @@ | |
| 167970 | } |
| 167971 | |
| 167972 | /* |
| 167973 | ** Step the RBU object. |
| 167974 | */ |
| 167975 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_step(sqlite3rbu *p){ |
| 167976 | if( p ){ |
| 167977 | switch( p->eStage ){ |
| 167978 | case RBU_STAGE_OAL: { |
| 167979 | RbuObjIter *pIter = &p->objiter; |
| 167980 | |
| @@ -168412,11 +168468,11 @@ | |
| 168412 | } |
| 168413 | |
| 168414 | /* |
| 168415 | ** Open and return a new RBU handle. |
| 168416 | */ |
| 168417 | SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_open( |
| 168418 | const char *zTarget, |
| 168419 | const char *zRbu, |
| 168420 | const char *zState |
| 168421 | ){ |
| 168422 | /* TODO: Check that zTarget and zRbu are non-NULL */ |
| @@ -168424,11 +168480,11 @@ | |
| 168424 | } |
| 168425 | |
| 168426 | /* |
| 168427 | ** Open a handle to begin or resume an RBU VACUUM operation. |
| 168428 | */ |
| 168429 | SQLITE_API sqlite3rbu *SQLITE_STDCALL sqlite3rbu_vacuum( |
| 168430 | const char *zTarget, |
| 168431 | const char *zState |
| 168432 | ){ |
| 168433 | /* TODO: Check that both arguments are non-NULL */ |
| 168434 | return openRbuHandle(0, zTarget, zState); |
| @@ -168435,11 +168491,11 @@ | |
| 168435 | } |
| 168436 | |
| 168437 | /* |
| 168438 | ** Return the database handle used by pRbu. |
| 168439 | */ |
| 168440 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){ |
| 168441 | sqlite3 *db = 0; |
| 168442 | if( pRbu ){ |
| 168443 | db = (bRbu ? pRbu->dbRbu : pRbu->dbMain); |
| 168444 | } |
| 168445 | return db; |
| @@ -168467,11 +168523,11 @@ | |
| 168467 | } |
| 168468 | |
| 168469 | /* |
| 168470 | ** Close the RBU handle. |
| 168471 | */ |
| 168472 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ |
| 168473 | int rc; |
| 168474 | if( p ){ |
| 168475 | |
| 168476 | /* Commit the transaction to the *-oal file. */ |
| 168477 | if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){ |
| @@ -168518,19 +168574,19 @@ | |
| 168518 | /* |
| 168519 | ** Return the total number of key-value operations (inserts, deletes or |
| 168520 | ** updates) that have been performed on the target database since the |
| 168521 | ** current RBU update was started. |
| 168522 | */ |
| 168523 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3rbu_progress(sqlite3rbu *pRbu){ |
| 168524 | return pRbu->nProgress; |
| 168525 | } |
| 168526 | |
| 168527 | /* |
| 168528 | ** Return permyriadage progress indications for the two main stages of |
| 168529 | ** an RBU update. |
| 168530 | */ |
| 168531 | SQLITE_API void SQLITE_STDCALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){ |
| 168532 | const int MAX_PROGRESS = 10000; |
| 168533 | switch( p->eStage ){ |
| 168534 | case RBU_STAGE_OAL: |
| 168535 | if( p->nPhaseOneStep>0 ){ |
| 168536 | *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep); |
| @@ -168561,11 +168617,11 @@ | |
| 168561 | } |
| 168562 | |
| 168563 | /* |
| 168564 | ** Return the current state of the RBU vacuum or update operation. |
| 168565 | */ |
| 168566 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_state(sqlite3rbu *p){ |
| 168567 | int aRes[] = { |
| 168568 | 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE, |
| 168569 | 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE |
| 168570 | }; |
| 168571 | |
| @@ -168589,11 +168645,11 @@ | |
| 168589 | ); |
| 168590 | return aRes[p->eStage]; |
| 168591 | } |
| 168592 | } |
| 168593 | |
| 168594 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_savestate(sqlite3rbu *p){ |
| 168595 | int rc = p->rc; |
| 168596 | if( rc==SQLITE_DONE ) return SQLITE_OK; |
| 168597 | |
| 168598 | assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE ); |
| 168599 | if( p->eStage==RBU_STAGE_OAL ){ |
| @@ -169416,11 +169472,11 @@ | |
| 169416 | |
| 169417 | /* |
| 169418 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 169419 | ** sqlite3rbu_create_vfs(). |
| 169420 | */ |
| 169421 | SQLITE_API void SQLITE_STDCALL sqlite3rbu_destroy_vfs(const char *zName){ |
| 169422 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zName); |
| 169423 | if( pVfs && pVfs->xOpen==rbuVfsOpen ){ |
| 169424 | sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex); |
| 169425 | sqlite3_vfs_unregister(pVfs); |
| 169426 | sqlite3_free(pVfs); |
| @@ -169430,11 +169486,11 @@ | |
| 169430 | /* |
| 169431 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 169432 | ** via existing VFS zParent. The new object is registered as a non-default |
| 169433 | ** VFS with SQLite before returning. |
| 169434 | */ |
| 169435 | SQLITE_API int SQLITE_STDCALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){ |
| 169436 | |
| 169437 | /* Template for VFS */ |
| 169438 | static sqlite3_vfs vfs_template = { |
| 169439 | 1, /* iVersion */ |
| 169440 | 0, /* szOsFile */ |
| @@ -171675,11 +171731,11 @@ | |
| 171675 | } |
| 171676 | |
| 171677 | return rc; |
| 171678 | } |
| 171679 | |
| 171680 | SQLITE_API int SQLITE_STDCALL sqlite3session_diff( |
| 171681 | sqlite3_session *pSession, |
| 171682 | const char *zFrom, |
| 171683 | const char *zTbl, |
| 171684 | char **pzErrMsg |
| 171685 | ){ |
| @@ -171769,11 +171825,11 @@ | |
| 171769 | |
| 171770 | /* |
| 171771 | ** Create a session object. This session object will record changes to |
| 171772 | ** database zDb attached to connection db. |
| 171773 | */ |
| 171774 | SQLITE_API int SQLITE_STDCALL sqlite3session_create( |
| 171775 | sqlite3 *db, /* Database handle */ |
| 171776 | const char *zDb, /* Name of db (e.g. "main") */ |
| 171777 | sqlite3_session **ppSession /* OUT: New session object */ |
| 171778 | ){ |
| 171779 | sqlite3_session *pNew; /* Newly allocated session object */ |
| @@ -171831,11 +171887,11 @@ | |
| 171831 | } |
| 171832 | |
| 171833 | /* |
| 171834 | ** Delete a session object previously allocated using sqlite3session_create(). |
| 171835 | */ |
| 171836 | SQLITE_API void SQLITE_STDCALL sqlite3session_delete(sqlite3_session *pSession){ |
| 171837 | sqlite3 *db = pSession->db; |
| 171838 | sqlite3_session *pHead; |
| 171839 | sqlite3_session **pp; |
| 171840 | |
| 171841 | /* Unlink the session from the linked list of sessions attached to the |
| @@ -171860,11 +171916,11 @@ | |
| 171860 | } |
| 171861 | |
| 171862 | /* |
| 171863 | ** Set a table filter on a Session Object. |
| 171864 | */ |
| 171865 | SQLITE_API void SQLITE_STDCALL sqlite3session_table_filter( |
| 171866 | sqlite3_session *pSession, |
| 171867 | int(*xFilter)(void*, const char*), |
| 171868 | void *pCtx /* First argument passed to xFilter */ |
| 171869 | ){ |
| 171870 | pSession->bAutoAttach = 1; |
| @@ -171878,11 +171934,11 @@ | |
| 171878 | ** |
| 171879 | ** Only tables that have a PRIMARY KEY defined may be attached. It does |
| 171880 | ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) |
| 171881 | ** or not. |
| 171882 | */ |
| 171883 | SQLITE_API int SQLITE_STDCALL sqlite3session_attach( |
| 171884 | sqlite3_session *pSession, /* Session object */ |
| 171885 | const char *zName /* Table name */ |
| 171886 | ){ |
| 171887 | int rc = SQLITE_OK; |
| 171888 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| @@ -172568,11 +172624,11 @@ | |
| 172568 | ** session object passed as the first argument. |
| 172569 | ** |
| 172570 | ** It is the responsibility of the caller to eventually free the buffer |
| 172571 | ** using sqlite3_free(). |
| 172572 | */ |
| 172573 | SQLITE_API int SQLITE_STDCALL sqlite3session_changeset( |
| 172574 | sqlite3_session *pSession, /* Session object */ |
| 172575 | int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ |
| 172576 | void **ppChangeset /* OUT: Buffer containing changeset */ |
| 172577 | ){ |
| 172578 | return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset); |
| @@ -172579,11 +172635,11 @@ | |
| 172579 | } |
| 172580 | |
| 172581 | /* |
| 172582 | ** Streaming version of sqlite3session_changeset(). |
| 172583 | */ |
| 172584 | SQLITE_API int SQLITE_STDCALL sqlite3session_changeset_strm( |
| 172585 | sqlite3_session *pSession, |
| 172586 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 172587 | void *pOut |
| 172588 | ){ |
| 172589 | return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0); |
| @@ -172590,11 +172646,11 @@ | |
| 172590 | } |
| 172591 | |
| 172592 | /* |
| 172593 | ** Streaming version of sqlite3session_patchset(). |
| 172594 | */ |
| 172595 | SQLITE_API int SQLITE_STDCALL sqlite3session_patchset_strm( |
| 172596 | sqlite3_session *pSession, |
| 172597 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 172598 | void *pOut |
| 172599 | ){ |
| 172600 | return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0); |
| @@ -172605,11 +172661,11 @@ | |
| 172605 | ** session object passed as the first argument. |
| 172606 | ** |
| 172607 | ** It is the responsibility of the caller to eventually free the buffer |
| 172608 | ** using sqlite3_free(). |
| 172609 | */ |
| 172610 | SQLITE_API int SQLITE_STDCALL sqlite3session_patchset( |
| 172611 | sqlite3_session *pSession, /* Session object */ |
| 172612 | int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */ |
| 172613 | void **ppPatchset /* OUT: Buffer containing changeset */ |
| 172614 | ){ |
| 172615 | return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset); |
| @@ -172616,11 +172672,11 @@ | |
| 172616 | } |
| 172617 | |
| 172618 | /* |
| 172619 | ** Enable or disable the session object passed as the first argument. |
| 172620 | */ |
| 172621 | SQLITE_API int SQLITE_STDCALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){ |
| 172622 | int ret; |
| 172623 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172624 | if( bEnable>=0 ){ |
| 172625 | pSession->bEnable = bEnable; |
| 172626 | } |
| @@ -172630,11 +172686,11 @@ | |
| 172630 | } |
| 172631 | |
| 172632 | /* |
| 172633 | ** Enable or disable the session object passed as the first argument. |
| 172634 | */ |
| 172635 | SQLITE_API int SQLITE_STDCALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){ |
| 172636 | int ret; |
| 172637 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172638 | if( bIndirect>=0 ){ |
| 172639 | pSession->bIndirect = bIndirect; |
| 172640 | } |
| @@ -172645,11 +172701,11 @@ | |
| 172645 | |
| 172646 | /* |
| 172647 | ** Return true if there have been no changes to monitored tables recorded |
| 172648 | ** by the session object passed as the only argument. |
| 172649 | */ |
| 172650 | SQLITE_API int SQLITE_STDCALL sqlite3session_isempty(sqlite3_session *pSession){ |
| 172651 | int ret = 0; |
| 172652 | SessionTable *pTab; |
| 172653 | |
| 172654 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172655 | for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){ |
| @@ -172695,11 +172751,11 @@ | |
| 172695 | } |
| 172696 | |
| 172697 | /* |
| 172698 | ** Create an iterator used to iterate through the contents of a changeset. |
| 172699 | */ |
| 172700 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_start( |
| 172701 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 172702 | int nChangeset, /* Size of buffer pChangeset in bytes */ |
| 172703 | void *pChangeset /* Pointer to buffer containing changeset */ |
| 172704 | ){ |
| 172705 | return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset); |
| @@ -172706,11 +172762,11 @@ | |
| 172706 | } |
| 172707 | |
| 172708 | /* |
| 172709 | ** Streaming version of sqlite3changeset_start(). |
| 172710 | */ |
| 172711 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_start_strm( |
| 172712 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 172713 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 172714 | void *pIn |
| 172715 | ){ |
| 172716 | return sessionChangesetStart(pp, xInput, pIn, 0, 0); |
| @@ -173127,20 +173183,20 @@ | |
| 173127 | ** or SQLITE_CORRUPT. |
| 173128 | ** |
| 173129 | ** This function may not be called on iterators passed to a conflict handler |
| 173130 | ** callback by changeset_apply(). |
| 173131 | */ |
| 173132 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_next(sqlite3_changeset_iter *p){ |
| 173133 | return sessionChangesetNext(p, 0, 0); |
| 173134 | } |
| 173135 | |
| 173136 | /* |
| 173137 | ** The following function extracts information on the current change |
| 173138 | ** from a changeset iterator. It may only be called after changeset_next() |
| 173139 | ** has returned SQLITE_ROW. |
| 173140 | */ |
| 173141 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_op( |
| 173142 | sqlite3_changeset_iter *pIter, /* Iterator handle */ |
| 173143 | const char **pzTab, /* OUT: Pointer to table name */ |
| 173144 | int *pnCol, /* OUT: Number of columns in table */ |
| 173145 | int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ |
| 173146 | int *pbIndirect /* OUT: True if change is indirect */ |
| @@ -173156,11 +173212,11 @@ | |
| 173156 | ** Return information regarding the PRIMARY KEY and number of columns in |
| 173157 | ** the database table affected by the change that pIter currently points |
| 173158 | ** to. This function may only be called after changeset_next() returns |
| 173159 | ** SQLITE_ROW. |
| 173160 | */ |
| 173161 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_pk( |
| 173162 | sqlite3_changeset_iter *pIter, /* Iterator object */ |
| 173163 | unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ |
| 173164 | int *pnCol /* OUT: Number of entries in output array */ |
| 173165 | ){ |
| 173166 | *pabPK = pIter->abPK; |
| @@ -173179,11 +173235,11 @@ | |
| 173179 | ** was not modified and is not a PK column), set *ppValue to NULL. |
| 173180 | ** |
| 173181 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 173182 | ** not modified. Otherwise, SQLITE_OK. |
| 173183 | */ |
| 173184 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_old( |
| 173185 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173186 | int iVal, /* Index of old.* value to retrieve */ |
| 173187 | sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ |
| 173188 | ){ |
| 173189 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){ |
| @@ -173207,11 +173263,11 @@ | |
| 173207 | ** was not modified), set *ppValue to NULL. |
| 173208 | ** |
| 173209 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 173210 | ** not modified. Otherwise, SQLITE_OK. |
| 173211 | */ |
| 173212 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_new( |
| 173213 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173214 | int iVal, /* Index of new.* value to retrieve */ |
| 173215 | sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ |
| 173216 | ){ |
| 173217 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){ |
| @@ -173241,11 +173297,11 @@ | |
| 173241 | ** containing the iVal'th value of the conflicting record. |
| 173242 | ** |
| 173243 | ** If value iVal is out-of-range or some other error occurs, an SQLite error |
| 173244 | ** code is returned. Otherwise, SQLITE_OK. |
| 173245 | */ |
| 173246 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_conflict( |
| 173247 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173248 | int iVal, /* Index of conflict record value to fetch */ |
| 173249 | sqlite3_value **ppValue /* OUT: Value from conflicting row */ |
| 173250 | ){ |
| 173251 | if( !pIter->pConflict ){ |
| @@ -173264,11 +173320,11 @@ | |
| 173264 | ** it sets the output variable to the total number of known foreign key |
| 173265 | ** violations in the destination database and returns SQLITE_OK. |
| 173266 | ** |
| 173267 | ** In all other cases this function returns SQLITE_MISUSE. |
| 173268 | */ |
| 173269 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_fk_conflicts( |
| 173270 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173271 | int *pnOut /* OUT: Number of FK violations */ |
| 173272 | ){ |
| 173273 | if( pIter->pConflict || pIter->apValue ){ |
| 173274 | return SQLITE_MISUSE; |
| @@ -173282,11 +173338,11 @@ | |
| 173282 | ** Finalize an iterator allocated with sqlite3changeset_start(). |
| 173283 | ** |
| 173284 | ** This function may not be called on iterators passed to a conflict handler |
| 173285 | ** callback by changeset_apply(). |
| 173286 | */ |
| 173287 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){ |
| 173288 | int rc = SQLITE_OK; |
| 173289 | if( p ){ |
| 173290 | int i; /* Used to iterate through p->apValue[] */ |
| 173291 | rc = p->rc; |
| 173292 | if( p->apValue ){ |
| @@ -173456,11 +173512,11 @@ | |
| 173456 | |
| 173457 | |
| 173458 | /* |
| 173459 | ** Invert a changeset object. |
| 173460 | */ |
| 173461 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert( |
| 173462 | int nChangeset, /* Number of bytes in input */ |
| 173463 | const void *pChangeset, /* Input changeset */ |
| 173464 | int *pnInverted, /* OUT: Number of bytes in output changeset */ |
| 173465 | void **ppInverted /* OUT: Inverse of pChangeset */ |
| 173466 | ){ |
| @@ -173475,11 +173531,11 @@ | |
| 173475 | } |
| 173476 | |
| 173477 | /* |
| 173478 | ** Streaming version of sqlite3changeset_invert(). |
| 173479 | */ |
| 173480 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_invert_strm( |
| 173481 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 173482 | void *pIn, |
| 173483 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 173484 | void *pOut |
| 173485 | ){ |
| @@ -174355,11 +174411,11 @@ | |
| 174355 | /* |
| 174356 | ** Apply the changeset passed via pChangeset/nChangeset to the main database |
| 174357 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 174358 | ** to resolve any conflicts encountered while applying the change. |
| 174359 | */ |
| 174360 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply( |
| 174361 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 174362 | int nChangeset, /* Size of changeset in bytes */ |
| 174363 | void *pChangeset, /* Changeset blob */ |
| 174364 | int(*xFilter)( |
| 174365 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| @@ -174383,11 +174439,11 @@ | |
| 174383 | /* |
| 174384 | ** Apply the changeset passed via xInput/pIn to the main database |
| 174385 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 174386 | ** to resolve any conflicts encountered while applying the change. |
| 174387 | */ |
| 174388 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_apply_strm( |
| 174389 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 174390 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 174391 | void *pIn, /* First arg for xInput */ |
| 174392 | int(*xFilter)( |
| 174393 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| @@ -174718,11 +174774,11 @@ | |
| 174718 | } |
| 174719 | |
| 174720 | /* |
| 174721 | ** Allocate a new, empty, sqlite3_changegroup. |
| 174722 | */ |
| 174723 | SQLITE_API int SQLITE_STDCALL sqlite3changegroup_new(sqlite3_changegroup **pp){ |
| 174724 | int rc = SQLITE_OK; /* Return code */ |
| 174725 | sqlite3_changegroup *p; /* New object */ |
| 174726 | p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup)); |
| 174727 | if( p==0 ){ |
| 174728 | rc = SQLITE_NOMEM; |
| @@ -174735,11 +174791,11 @@ | |
| 174735 | |
| 174736 | /* |
| 174737 | ** Add the changeset currently stored in buffer pData, size nData bytes, |
| 174738 | ** to changeset-group p. |
| 174739 | */ |
| 174740 | SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){ |
| 174741 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| 174742 | int rc; /* Return code */ |
| 174743 | |
| 174744 | rc = sqlite3changeset_start(&pIter, nData, pData); |
| 174745 | if( rc==SQLITE_OK ){ |
| @@ -174751,11 +174807,11 @@ | |
| 174751 | |
| 174752 | /* |
| 174753 | ** Obtain a buffer containing a changeset representing the concatenation |
| 174754 | ** of all changesets added to the group so far. |
| 174755 | */ |
| 174756 | SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output( |
| 174757 | sqlite3_changegroup *pGrp, |
| 174758 | int *pnData, |
| 174759 | void **ppData |
| 174760 | ){ |
| 174761 | return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData); |
| @@ -174762,11 +174818,11 @@ | |
| 174762 | } |
| 174763 | |
| 174764 | /* |
| 174765 | ** Streaming versions of changegroup_add(). |
| 174766 | */ |
| 174767 | SQLITE_API int SQLITE_STDCALL sqlite3changegroup_add_strm( |
| 174768 | sqlite3_changegroup *pGrp, |
| 174769 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 174770 | void *pIn |
| 174771 | ){ |
| 174772 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| @@ -174781,11 +174837,11 @@ | |
| 174781 | } |
| 174782 | |
| 174783 | /* |
| 174784 | ** Streaming versions of changegroup_output(). |
| 174785 | */ |
| 174786 | SQLITE_API int SQLITE_STDCALL sqlite3changegroup_output_strm( |
| 174787 | sqlite3_changegroup *pGrp, |
| 174788 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 174789 | void *pOut |
| 174790 | ){ |
| 174791 | return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0); |
| @@ -174792,21 +174848,21 @@ | |
| 174792 | } |
| 174793 | |
| 174794 | /* |
| 174795 | ** Delete a changegroup object. |
| 174796 | */ |
| 174797 | SQLITE_API void SQLITE_STDCALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ |
| 174798 | if( pGrp ){ |
| 174799 | sessionDeleteTable(pGrp->pList); |
| 174800 | sqlite3_free(pGrp); |
| 174801 | } |
| 174802 | } |
| 174803 | |
| 174804 | /* |
| 174805 | ** Combine two changesets together. |
| 174806 | */ |
| 174807 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat( |
| 174808 | int nLeft, /* Number of bytes in lhs input */ |
| 174809 | void *pLeft, /* Lhs input changeset */ |
| 174810 | int nRight /* Number of bytes in rhs input */, |
| 174811 | void *pRight, /* Rhs input changeset */ |
| 174812 | int *pnOut, /* OUT: Number of bytes in output changeset */ |
| @@ -174831,11 +174887,11 @@ | |
| 174831 | } |
| 174832 | |
| 174833 | /* |
| 174834 | ** Streaming version of sqlite3changeset_concat(). |
| 174835 | */ |
| 174836 | SQLITE_API int SQLITE_STDCALL sqlite3changeset_concat_strm( |
| 174837 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 174838 | void *pInA, |
| 174839 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| 174840 | void *pInB, |
| 174841 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| @@ -177062,11 +177118,11 @@ | |
| 177062 | |
| 177063 | #ifndef SQLITE_CORE |
| 177064 | #ifdef _WIN32 |
| 177065 | __declspec(dllexport) |
| 177066 | #endif |
| 177067 | SQLITE_API int SQLITE_STDCALL sqlite3_json_init( |
| 177068 | sqlite3 *db, |
| 177069 | char **pzErrMsg, |
| 177070 | const sqlite3_api_routines *pApi |
| 177071 | ){ |
| 177072 | SQLITE_EXTENSION_INIT2(pApi); |
| @@ -193895,11 +193951,11 @@ | |
| 193895 | int nArg, /* Number of args */ |
| 193896 | sqlite3_value **apUnused /* Function arguments */ |
| 193897 | ){ |
| 193898 | assert( nArg==0 ); |
| 193899 | UNUSED_PARAM2(nArg, apUnused); |
| 193900 | sqlite3_result_text(pCtx, "fts5: 2016-07-26 10:46:21 483994a54dee3c7a3801e0e9d3c96fa9dbd8d2fd", -1, SQLITE_TRANSIENT); |
| 193901 | } |
| 193902 | |
| 193903 | static int fts5Init(sqlite3 *db){ |
| 193904 | static const sqlite3_module fts5Mod = { |
| 193905 | /* iVersion */ 2, |
| @@ -193983,11 +194039,11 @@ | |
| 193983 | */ |
| 193984 | #ifndef SQLITE_CORE |
| 193985 | #ifdef _WIN32 |
| 193986 | __declspec(dllexport) |
| 193987 | #endif |
| 193988 | SQLITE_API int SQLITE_STDCALL sqlite3_fts_init( |
| 193989 | sqlite3 *db, |
| 193990 | char **pzErrMsg, |
| 193991 | const sqlite3_api_routines *pApi |
| 193992 | ){ |
| 193993 | SQLITE_EXTENSION_INIT2(pApi); |
| @@ -193996,11 +194052,11 @@ | |
| 193996 | } |
| 193997 | |
| 193998 | #ifdef _WIN32 |
| 193999 | __declspec(dllexport) |
| 194000 | #endif |
| 194001 | SQLITE_API int SQLITE_STDCALL sqlite3_fts5_init( |
| 194002 | sqlite3 *db, |
| 194003 | char **pzErrMsg, |
| 194004 | const sqlite3_api_routines *pApi |
| 194005 | ){ |
| 194006 | SQLITE_EXTENSION_INIT2(pApi); |
| 194007 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -65,10 +65,18 @@ | |
| 65 | ** In all cases, the special comment must be enclosed in the usual |
| 66 | ** slash-asterisk...asterisk-slash comment marks, with no spaces between the |
| 67 | ** asterisks and the comment text. |
| 68 | */ |
| 69 | |
| 70 | /* |
| 71 | ** Make sure the Tcl calling convention macro is defined. This macro is |
| 72 | ** only used by test code and Tcl integration code. |
| 73 | */ |
| 74 | #ifndef SQLITE_TCLAPI |
| 75 | # define SQLITE_TCLAPI |
| 76 | #endif |
| 77 | |
| 78 | /* |
| 79 | ** Make sure that rand_s() is available on Windows systems with MSVC 2005 |
| 80 | ** or higher. |
| 81 | */ |
| 82 | #if defined(_MSC_VER) && _MSC_VER>=1400 |
| @@ -304,12 +312,21 @@ | |
| 312 | # define SQLITE_API |
| 313 | #endif |
| 314 | #ifndef SQLITE_CDECL |
| 315 | # define SQLITE_CDECL |
| 316 | #endif |
| 317 | #ifndef SQLITE_APICALL |
| 318 | # define SQLITE_APICALL |
| 319 | #endif |
| 320 | #ifndef SQLITE_STDCALL |
| 321 | # define SQLITE_STDCALL SQLITE_APICALL |
| 322 | #endif |
| 323 | #ifndef SQLITE_CALLBACK |
| 324 | # define SQLITE_CALLBACK |
| 325 | #endif |
| 326 | #ifndef SQLITE_SYSAPI |
| 327 | # define SQLITE_SYSAPI |
| 328 | #endif |
| 329 | |
| 330 | /* |
| 331 | ** These no-op macros are used in front of interfaces to mark those |
| 332 | ** interfaces as either deprecated or experimental. New applications |
| @@ -363,11 +380,11 @@ | |
| 380 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 381 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 382 | */ |
| 383 | #define SQLITE_VERSION "3.14.0" |
| 384 | #define SQLITE_VERSION_NUMBER 3014000 |
| 385 | #define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914" |
| 386 | |
| 387 | /* |
| 388 | ** CAPI3REF: Run-Time Library Version Numbers |
| 389 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 390 | ** |
| @@ -396,13 +413,13 @@ | |
| 413 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 414 | ** |
| 415 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 416 | */ |
| 417 | SQLITE_API const char sqlite3_version[] = SQLITE_VERSION; |
| 418 | SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void); |
| 419 | SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void); |
| 420 | SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void); |
| 421 | |
| 422 | /* |
| 423 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 424 | ** |
| 425 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| @@ -423,12 +440,12 @@ | |
| 440 | ** |
| 441 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 442 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 443 | */ |
| 444 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 445 | SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName); |
| 446 | SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N); |
| 447 | #endif |
| 448 | |
| 449 | /* |
| 450 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 451 | ** |
| @@ -463,11 +480,11 @@ | |
| 480 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 481 | ** is unchanged by calls to sqlite3_config().)^ |
| 482 | ** |
| 483 | ** See the [threading mode] documentation for additional information. |
| 484 | */ |
| 485 | SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void); |
| 486 | |
| 487 | /* |
| 488 | ** CAPI3REF: Database Connection Handle |
| 489 | ** KEYWORDS: {database connection} {database connections} |
| 490 | ** |
| @@ -560,19 +577,19 @@ | |
| 577 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 578 | ** [sqlite3_open_v2()], and not previously closed. |
| 579 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 580 | ** argument is a harmless no-op. |
| 581 | */ |
| 582 | SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*); |
| 583 | SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*); |
| 584 | |
| 585 | /* |
| 586 | ** The type for a callback function. |
| 587 | ** This is legacy and deprecated. It is included for historical |
| 588 | ** compatibility and is not documented. |
| 589 | */ |
| 590 | typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); |
| 591 | |
| 592 | /* |
| 593 | ** CAPI3REF: One-Step Query Execution Interface |
| 594 | ** METHOD: sqlite3 |
| 595 | ** |
| @@ -632,14 +649,14 @@ | |
| 649 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 650 | ** <li> The application must not modify the SQL statement text passed into |
| 651 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 652 | ** </ul> |
| 653 | */ |
| 654 | SQLITE_API int SQLITE_APICALL sqlite3_exec( |
| 655 | sqlite3*, /* An open database */ |
| 656 | const char *sql, /* SQL to be evaluated */ |
| 657 | int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */ |
| 658 | void *, /* 1st argument to callback */ |
| 659 | char **errmsg /* Error msg written here */ |
| 660 | ); |
| 661 | |
| 662 | /* |
| @@ -983,30 +1000,30 @@ | |
| 1000 | ** database corruption. |
| 1001 | */ |
| 1002 | typedef struct sqlite3_io_methods sqlite3_io_methods; |
| 1003 | struct sqlite3_io_methods { |
| 1004 | int iVersion; |
| 1005 | int (SQLITE_CALLBACK *xClose)(sqlite3_file*); |
| 1006 | int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); |
| 1007 | int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); |
| 1008 | int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size); |
| 1009 | int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags); |
| 1010 | int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); |
| 1011 | int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int); |
| 1012 | int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int); |
| 1013 | int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut); |
| 1014 | int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg); |
| 1015 | int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*); |
| 1016 | int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*); |
| 1017 | /* Methods above are valid for version 1 */ |
| 1018 | int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); |
| 1019 | int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags); |
| 1020 | void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*); |
| 1021 | int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag); |
| 1022 | /* Methods above are valid for version 2 */ |
| 1023 | int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); |
| 1024 | int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); |
| 1025 | /* Methods above are valid for version 3 */ |
| 1026 | /* Additional methods may be added in future releases */ |
| 1027 | }; |
| 1028 | |
| 1029 | /* |
| @@ -1178,11 +1195,11 @@ | |
| 1195 | ** ^The [SQLITE_FCNTL_BUSYHANDLER] |
| 1196 | ** file-control may be invoked by SQLite on the database file handle |
| 1197 | ** shortly after it is opened in order to provide a custom VFS with access |
| 1198 | ** to the connections busy-handler callback. The argument is of type (void **) |
| 1199 | ** - an array of two (void *) values. The first (void *) actually points |
| 1200 | ** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections |
| 1201 | ** busy-handler, this function should be invoked with the second (void *) in |
| 1202 | ** the array as the only argument. If it returns non-zero, then the operation |
| 1203 | ** should be retried. If it returns zero, the custom VFS should abandon the |
| 1204 | ** current operation. |
| 1205 | ** |
| @@ -1444,43 +1461,43 @@ | |
| 1461 | ** or all of these interfaces to be NULL or for their behavior to change |
| 1462 | ** from one release to the next. Applications must not attempt to access |
| 1463 | ** any of these methods if the iVersion of the VFS is less than 3. |
| 1464 | */ |
| 1465 | typedef struct sqlite3_vfs sqlite3_vfs; |
| 1466 | typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void); |
| 1467 | struct sqlite3_vfs { |
| 1468 | int iVersion; /* Structure version number (currently 3) */ |
| 1469 | int szOsFile; /* Size of subclassed sqlite3_file */ |
| 1470 | int mxPathname; /* Maximum file pathname length */ |
| 1471 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1472 | const char *zName; /* Name of this virtual file system */ |
| 1473 | void *pAppData; /* Pointer to application-specific data */ |
| 1474 | int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, |
| 1475 | int flags, int *pOutFlags); |
| 1476 | int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir); |
| 1477 | int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); |
| 1478 | int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); |
| 1479 | void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename); |
| 1480 | void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); |
| 1481 | void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); |
| 1482 | void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*); |
| 1483 | int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut); |
| 1484 | int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds); |
| 1485 | int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*); |
| 1486 | int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *); |
| 1487 | /* |
| 1488 | ** The methods above are in version 1 of the sqlite_vfs object |
| 1489 | ** definition. Those that follow are added in version 2 or later |
| 1490 | */ |
| 1491 | int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); |
| 1492 | /* |
| 1493 | ** The methods above are in versions 1 and 2 of the sqlite_vfs object. |
| 1494 | ** Those below are for version 3 and greater. |
| 1495 | */ |
| 1496 | int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); |
| 1497 | sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName); |
| 1498 | const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName); |
| 1499 | /* |
| 1500 | ** The methods above are in versions 1 through 3 of the sqlite_vfs object. |
| 1501 | ** New fields may be appended in future versions. The iVersion |
| 1502 | ** value will increment whenever this happens. |
| 1503 | */ |
| @@ -1621,14 +1638,14 @@ | |
| 1638 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1639 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1640 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1641 | ** failure. |
| 1642 | */ |
| 1643 | SQLITE_API int SQLITE_APICALL sqlite3_initialize(void); |
| 1644 | SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void); |
| 1645 | SQLITE_API int SQLITE_APICALL sqlite3_os_init(void); |
| 1646 | SQLITE_API int SQLITE_APICALL sqlite3_os_end(void); |
| 1647 | |
| 1648 | /* |
| 1649 | ** CAPI3REF: Configuring The SQLite Library |
| 1650 | ** |
| 1651 | ** The sqlite3_config() interface is used to make global configuration |
| @@ -1743,17 +1760,17 @@ | |
| 1760 | ** SQLite will never invoke xInit() more than once without an intervening |
| 1761 | ** call to xShutdown(). |
| 1762 | */ |
| 1763 | typedef struct sqlite3_mem_methods sqlite3_mem_methods; |
| 1764 | struct sqlite3_mem_methods { |
| 1765 | void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */ |
| 1766 | void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */ |
| 1767 | void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */ |
| 1768 | int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */ |
| 1769 | int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */ |
| 1770 | int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */ |
| 1771 | void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */ |
| 1772 | void *pAppData; /* Argument to xInit() and xShutdown() */ |
| 1773 | }; |
| 1774 | |
| 1775 | /* |
| 1776 | ** CAPI3REF: Configuration Options |
| @@ -1966,11 +1983,11 @@ | |
| 1983 | ** |
| 1984 | ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt> |
| 1985 | ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite |
| 1986 | ** global [error log]. |
| 1987 | ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a |
| 1988 | ** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*), |
| 1989 | ** and a pointer to void. ^If the function pointer is not NULL, it is |
| 1990 | ** invoked by [sqlite3_log()] to process each logging event. ^If the |
| 1991 | ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. |
| 1992 | ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is |
| 1993 | ** passed through as the first parameter to the application-defined logger |
| @@ -2019,11 +2036,11 @@ | |
| 2036 | ** |
| 2037 | ** [[SQLITE_CONFIG_SQLLOG]] |
| 2038 | ** <dt>SQLITE_CONFIG_SQLLOG |
| 2039 | ** <dd>This option is only available if sqlite is compiled with the |
| 2040 | ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should |
| 2041 | ** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int). |
| 2042 | ** The second should be of type (void*). The callback is invoked by the library |
| 2043 | ** in three separate circumstances, identified by the value passed as the |
| 2044 | ** fourth parameter. If the fourth parameter is 0, then the database connection |
| 2045 | ** passed as the second argument has just been opened. The third argument |
| 2046 | ** points to a buffer containing the name of the main database file. If the |
| @@ -2217,11 +2234,11 @@ | |
| 2234 | ** |
| 2235 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 2236 | ** [extended result codes] feature of SQLite. ^The extended result |
| 2237 | ** codes are disabled by default for historical compatibility. |
| 2238 | */ |
| 2239 | SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff); |
| 2240 | |
| 2241 | /* |
| 2242 | ** CAPI3REF: Last Insert Rowid |
| 2243 | ** METHOD: sqlite3 |
| 2244 | ** |
| @@ -2269,11 +2286,11 @@ | |
| 2286 | ** function is running and thus changes the last insert [rowid], |
| 2287 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2288 | ** unpredictable and might not equal either the old or the new |
| 2289 | ** last insert [rowid]. |
| 2290 | */ |
| 2291 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*); |
| 2292 | |
| 2293 | /* |
| 2294 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2295 | ** METHOD: sqlite3 |
| 2296 | ** |
| @@ -2322,11 +2339,11 @@ | |
| 2339 | ** |
| 2340 | ** If a separate thread makes changes on the same database connection |
| 2341 | ** while [sqlite3_changes()] is running then the value returned |
| 2342 | ** is unpredictable and not meaningful. |
| 2343 | */ |
| 2344 | SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*); |
| 2345 | |
| 2346 | /* |
| 2347 | ** CAPI3REF: Total Number Of Rows Modified |
| 2348 | ** METHOD: sqlite3 |
| 2349 | ** |
| @@ -2346,11 +2363,11 @@ | |
| 2363 | ** |
| 2364 | ** If a separate thread makes changes on the same database connection |
| 2365 | ** while [sqlite3_total_changes()] is running then the value |
| 2366 | ** returned is unpredictable and not meaningful. |
| 2367 | */ |
| 2368 | SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*); |
| 2369 | |
| 2370 | /* |
| 2371 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2372 | ** METHOD: sqlite3 |
| 2373 | ** |
| @@ -2386,11 +2403,11 @@ | |
| 2403 | ** that are started after the sqlite3_interrupt() call returns. |
| 2404 | ** |
| 2405 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2406 | ** is running then bad things will likely happen. |
| 2407 | */ |
| 2408 | SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*); |
| 2409 | |
| 2410 | /* |
| 2411 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2412 | ** |
| 2413 | ** These routines are useful during command-line input to determine if the |
| @@ -2421,12 +2438,12 @@ | |
| 2438 | ** UTF-8 string. |
| 2439 | ** |
| 2440 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2441 | ** UTF-16 string in native byte order. |
| 2442 | */ |
| 2443 | SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql); |
| 2444 | SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql); |
| 2445 | |
| 2446 | /* |
| 2447 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2448 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2449 | ** METHOD: sqlite3 |
| @@ -2483,11 +2500,11 @@ | |
| 2500 | ** result in undefined behavior. |
| 2501 | ** |
| 2502 | ** A busy handler must not close the database connection |
| 2503 | ** or [prepared statement] that invoked the busy handler. |
| 2504 | */ |
| 2505 | SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); |
| 2506 | |
| 2507 | /* |
| 2508 | ** CAPI3REF: Set A Busy Timeout |
| 2509 | ** METHOD: sqlite3 |
| 2510 | ** |
| @@ -2506,11 +2523,11 @@ | |
| 2523 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2524 | ** this routine, that other busy handler is cleared.)^ |
| 2525 | ** |
| 2526 | ** See also: [PRAGMA busy_timeout] |
| 2527 | */ |
| 2528 | SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms); |
| 2529 | |
| 2530 | /* |
| 2531 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2532 | ** METHOD: sqlite3 |
| 2533 | ** |
| @@ -2581,19 +2598,19 @@ | |
| 2598 | ** interface defined here. As a consequence, errors that occur in the |
| 2599 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2600 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2601 | ** [sqlite3_errmsg()]. |
| 2602 | */ |
| 2603 | SQLITE_API int SQLITE_APICALL sqlite3_get_table( |
| 2604 | sqlite3 *db, /* An open database */ |
| 2605 | const char *zSql, /* SQL to be evaluated */ |
| 2606 | char ***pazResult, /* Results of the query */ |
| 2607 | int *pnRow, /* Number of result rows written here */ |
| 2608 | int *pnColumn, /* Number of result columns written here */ |
| 2609 | char **pzErrmsg /* Error msg written here */ |
| 2610 | ); |
| 2611 | SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result); |
| 2612 | |
| 2613 | /* |
| 2614 | ** CAPI3REF: Formatted String Printing Functions |
| 2615 | ** |
| 2616 | ** These routines are work-alikes of the "printf()" family of functions |
| @@ -2696,13 +2713,13 @@ | |
| 2713 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2714 | ** addition that after the string has been read and copied into |
| 2715 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2716 | */ |
| 2717 | SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2718 | SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list); |
| 2719 | SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2720 | SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list); |
| 2721 | |
| 2722 | /* |
| 2723 | ** CAPI3REF: Memory Allocation Subsystem |
| 2724 | ** |
| 2725 | ** The SQLite core uses these three routines for all of its own |
| @@ -2788,16 +2805,16 @@ | |
| 2805 | ** |
| 2806 | ** The application must not read or write any part of |
| 2807 | ** a block of memory after it has been released using |
| 2808 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2809 | */ |
| 2810 | SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int); |
| 2811 | SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64); |
| 2812 | SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int); |
| 2813 | SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64); |
| 2814 | SQLITE_API void SQLITE_APICALL sqlite3_free(void*); |
| 2815 | SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*); |
| 2816 | |
| 2817 | /* |
| 2818 | ** CAPI3REF: Memory Allocator Statistics |
| 2819 | ** |
| 2820 | ** SQLite provides these two interfaces for reporting on the status |
| @@ -2818,12 +2835,12 @@ | |
| 2835 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2836 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2837 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2838 | ** prior to the reset. |
| 2839 | */ |
| 2840 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void); |
| 2841 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag); |
| 2842 | |
| 2843 | /* |
| 2844 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2845 | ** |
| 2846 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| @@ -2842,11 +2859,11 @@ | |
| 2859 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2860 | ** non-NULL P then the pseudo-randomness is generated |
| 2861 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2862 | ** method. |
| 2863 | */ |
| 2864 | SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P); |
| 2865 | |
| 2866 | /* |
| 2867 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2868 | ** METHOD: sqlite3 |
| 2869 | ** |
| @@ -2925,13 +2942,13 @@ | |
| 2942 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2943 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2944 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2945 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2946 | */ |
| 2947 | SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer( |
| 2948 | sqlite3*, |
| 2949 | int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 2950 | void *pUserData |
| 2951 | ); |
| 2952 | |
| 2953 | /* |
| 2954 | ** CAPI3REF: Authorizer Return Codes |
| @@ -3033,14 +3050,14 @@ | |
| 3050 | ** digits in the time are meaningless. Future versions of SQLite |
| 3051 | ** might provide greater resolution on the profiler callback. The |
| 3052 | ** sqlite3_profile() function is considered experimental and is |
| 3053 | ** subject to change in future versions of SQLite. |
| 3054 | */ |
| 3055 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*, |
| 3056 | void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*); |
| 3057 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*, |
| 3058 | void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*); |
| 3059 | |
| 3060 | /* |
| 3061 | ** CAPI3REF: SQL Trace Event Codes |
| 3062 | ** KEYWORDS: SQLITE_TRACE |
| 3063 | ** |
| @@ -3124,14 +3141,14 @@ | |
| 3141 | ** |
| 3142 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 3143 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 3144 | ** are deprecated. |
| 3145 | */ |
| 3146 | SQLITE_API int SQLITE_APICALL sqlite3_trace_v2( |
| 3147 | sqlite3*, |
| 3148 | unsigned uMask, |
| 3149 | int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*), |
| 3150 | void *pCtx |
| 3151 | ); |
| 3152 | |
| 3153 | /* |
| 3154 | ** CAPI3REF: Query Progress Callbacks |
| @@ -3163,11 +3180,11 @@ | |
| 3180 | ** the database connection that invoked the progress handler. |
| 3181 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 3182 | ** database connections for the meaning of "modify" in this paragraph. |
| 3183 | ** |
| 3184 | */ |
| 3185 | SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*); |
| 3186 | |
| 3187 | /* |
| 3188 | ** CAPI3REF: Opening A New Database Connection |
| 3189 | ** CONSTRUCTOR: sqlite3 |
| 3190 | ** |
| @@ -3392,19 +3409,19 @@ | |
| 3409 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3410 | ** features that require the use of temporary files may fail. |
| 3411 | ** |
| 3412 | ** See also: [sqlite3_temp_directory] |
| 3413 | */ |
| 3414 | SQLITE_API int SQLITE_APICALL sqlite3_open( |
| 3415 | const char *filename, /* Database filename (UTF-8) */ |
| 3416 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3417 | ); |
| 3418 | SQLITE_API int SQLITE_APICALL sqlite3_open16( |
| 3419 | const void *filename, /* Database filename (UTF-16) */ |
| 3420 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3421 | ); |
| 3422 | SQLITE_API int SQLITE_APICALL sqlite3_open_v2( |
| 3423 | const char *filename, /* Database filename (UTF-8) */ |
| 3424 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3425 | int flags, /* Flags */ |
| 3426 | const char *zVfs /* Name of VFS module to use */ |
| 3427 | ); |
| @@ -3446,13 +3463,13 @@ | |
| 3463 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3464 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3465 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3466 | ** undesirable. |
| 3467 | */ |
| 3468 | SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); |
| 3469 | SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); |
| 3470 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); |
| 3471 | |
| 3472 | |
| 3473 | /* |
| 3474 | ** CAPI3REF: Error Codes And Messages |
| 3475 | ** METHOD: sqlite3 |
| @@ -3492,15 +3509,15 @@ | |
| 3509 | ** |
| 3510 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3511 | ** was invoked incorrectly by the application. In that case, the |
| 3512 | ** error code and message may or may not be set. |
| 3513 | */ |
| 3514 | SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db); |
| 3515 | SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db); |
| 3516 | SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*); |
| 3517 | SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*); |
| 3518 | SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int); |
| 3519 | |
| 3520 | /* |
| 3521 | ** CAPI3REF: Prepared Statement Object |
| 3522 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3523 | ** |
| @@ -3564,11 +3581,11 @@ | |
| 3581 | ** created by an untrusted script can be contained using the |
| 3582 | ** [max_page_count] [PRAGMA]. |
| 3583 | ** |
| 3584 | ** New run-time limit categories may be added in future releases. |
| 3585 | */ |
| 3586 | SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal); |
| 3587 | |
| 3588 | /* |
| 3589 | ** CAPI3REF: Run-Time Limit Categories |
| 3590 | ** KEYWORDS: {limit category} {*limit categories} |
| 3591 | ** |
| @@ -3716,32 +3733,32 @@ | |
| 3733 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3734 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3735 | ** </li> |
| 3736 | ** </ol> |
| 3737 | */ |
| 3738 | SQLITE_API int SQLITE_APICALL sqlite3_prepare( |
| 3739 | sqlite3 *db, /* Database handle */ |
| 3740 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3741 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3742 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3743 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3744 | ); |
| 3745 | SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2( |
| 3746 | sqlite3 *db, /* Database handle */ |
| 3747 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3748 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3749 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3750 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3751 | ); |
| 3752 | SQLITE_API int SQLITE_APICALL sqlite3_prepare16( |
| 3753 | sqlite3 *db, /* Database handle */ |
| 3754 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3755 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3756 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3757 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3758 | ); |
| 3759 | SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2( |
| 3760 | sqlite3 *db, /* Database handle */ |
| 3761 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3762 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3763 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3764 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| @@ -3776,12 +3793,12 @@ | |
| 3793 | ** automatically freed when the prepared statement is finalized. |
| 3794 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3795 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3796 | ** by passing it to [sqlite3_free()]. |
| 3797 | */ |
| 3798 | SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt); |
| 3799 | SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); |
| 3800 | |
| 3801 | /* |
| 3802 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3803 | ** METHOD: sqlite3_stmt |
| 3804 | ** |
| @@ -3809,11 +3826,11 @@ | |
| 3826 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3827 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3828 | ** change the configuration of a database connection, they do not make |
| 3829 | ** changes to the content of the database files on disk. |
| 3830 | */ |
| 3831 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 3832 | |
| 3833 | /* |
| 3834 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3835 | ** METHOD: sqlite3_stmt |
| 3836 | ** |
| @@ -3830,11 +3847,11 @@ | |
| 3847 | ** to locate all prepared statements associated with a database |
| 3848 | ** connection that are in need of being reset. This can be used, |
| 3849 | ** for example, in diagnostic routines to search for prepared |
| 3850 | ** statements that are holding a transaction open. |
| 3851 | */ |
| 3852 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*); |
| 3853 | |
| 3854 | /* |
| 3855 | ** CAPI3REF: Dynamically Typed Value Object |
| 3856 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3857 | ** |
| @@ -3994,24 +4011,24 @@ | |
| 4011 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 4012 | ** |
| 4013 | ** See also: [sqlite3_bind_parameter_count()], |
| 4014 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 4015 | */ |
| 4016 | SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*)); |
| 4017 | SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, |
| 4018 | void(SQLITE_CALLBACK *)(void*)); |
| 4019 | SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double); |
| 4020 | SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int); |
| 4021 | SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); |
| 4022 | SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int); |
| 4023 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*)); |
| 4024 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*)); |
| 4025 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 4026 | void(SQLITE_CALLBACK *)(void*), unsigned char encoding); |
| 4027 | SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 4028 | SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 4029 | SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); |
| 4030 | |
| 4031 | /* |
| 4032 | ** CAPI3REF: Number Of SQL Parameters |
| 4033 | ** METHOD: sqlite3_stmt |
| 4034 | ** |
| @@ -4028,11 +4045,11 @@ | |
| 4045 | ** |
| 4046 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4047 | ** [sqlite3_bind_parameter_name()], and |
| 4048 | ** [sqlite3_bind_parameter_index()]. |
| 4049 | */ |
| 4050 | SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*); |
| 4051 | |
| 4052 | /* |
| 4053 | ** CAPI3REF: Name Of A Host Parameter |
| 4054 | ** METHOD: sqlite3_stmt |
| 4055 | ** |
| @@ -4056,11 +4073,11 @@ | |
| 4073 | ** |
| 4074 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4075 | ** [sqlite3_bind_parameter_count()], and |
| 4076 | ** [sqlite3_bind_parameter_index()]. |
| 4077 | */ |
| 4078 | SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); |
| 4079 | |
| 4080 | /* |
| 4081 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 4082 | ** METHOD: sqlite3_stmt |
| 4083 | ** |
| @@ -4073,21 +4090,21 @@ | |
| 4090 | ** |
| 4091 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 4092 | ** [sqlite3_bind_parameter_count()], and |
| 4093 | ** [sqlite3_bind_parameter_name()]. |
| 4094 | */ |
| 4095 | SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); |
| 4096 | |
| 4097 | /* |
| 4098 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 4099 | ** METHOD: sqlite3_stmt |
| 4100 | ** |
| 4101 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 4102 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 4103 | ** ^Use this routine to reset all host parameters to NULL. |
| 4104 | */ |
| 4105 | SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*); |
| 4106 | |
| 4107 | /* |
| 4108 | ** CAPI3REF: Number Of Columns In A Result Set |
| 4109 | ** METHOD: sqlite3_stmt |
| 4110 | ** |
| @@ -4095,11 +4112,11 @@ | |
| 4112 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 4113 | ** statement that does not return data (for example an [UPDATE]). |
| 4114 | ** |
| 4115 | ** See also: [sqlite3_data_count()] |
| 4116 | */ |
| 4117 | SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt); |
| 4118 | |
| 4119 | /* |
| 4120 | ** CAPI3REF: Column Names In A Result Set |
| 4121 | ** METHOD: sqlite3_stmt |
| 4122 | ** |
| @@ -4124,12 +4141,12 @@ | |
| 4141 | ** ^The name of a result column is the value of the "AS" clause for |
| 4142 | ** that column, if there is an AS clause. If there is no AS clause |
| 4143 | ** then the name of the column is unspecified and may change from |
| 4144 | ** one release of SQLite to the next. |
| 4145 | */ |
| 4146 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N); |
| 4147 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N); |
| 4148 | |
| 4149 | /* |
| 4150 | ** CAPI3REF: Source Of Data In A Query Result |
| 4151 | ** METHOD: sqlite3_stmt |
| 4152 | ** |
| @@ -4173,16 +4190,16 @@ | |
| 4190 | ** If two or more threads call one or more |
| 4191 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 4192 | ** for the same [prepared statement] and result column |
| 4193 | ** at the same time then the results are undefined. |
| 4194 | */ |
| 4195 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int); |
| 4196 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int); |
| 4197 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int); |
| 4198 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int); |
| 4199 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int); |
| 4200 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int); |
| 4201 | |
| 4202 | /* |
| 4203 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 4204 | ** METHOD: sqlite3_stmt |
| 4205 | ** |
| @@ -4210,12 +4227,12 @@ | |
| 4227 | ** data stored in that column is of the declared type. SQLite is |
| 4228 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 4229 | ** is associated with individual values, not with the containers |
| 4230 | ** used to hold those values. |
| 4231 | */ |
| 4232 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int); |
| 4233 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int); |
| 4234 | |
| 4235 | /* |
| 4236 | ** CAPI3REF: Evaluate An SQL Statement |
| 4237 | ** METHOD: sqlite3_stmt |
| 4238 | ** |
| @@ -4291,11 +4308,11 @@ | |
| 4308 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4309 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4310 | ** then the more specific [error codes] are returned directly |
| 4311 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4312 | */ |
| 4313 | SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*); |
| 4314 | |
| 4315 | /* |
| 4316 | ** CAPI3REF: Number of columns in a result set |
| 4317 | ** METHOD: sqlite3_stmt |
| 4318 | ** |
| @@ -4312,11 +4329,11 @@ | |
| 4329 | ** where it always returns zero since each step of that multi-step |
| 4330 | ** pragma returns 0 columns of data. |
| 4331 | ** |
| 4332 | ** See also: [sqlite3_column_count()] |
| 4333 | */ |
| 4334 | SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt); |
| 4335 | |
| 4336 | /* |
| 4337 | ** CAPI3REF: Fundamental Datatypes |
| 4338 | ** KEYWORDS: SQLITE_TEXT |
| 4339 | ** |
| @@ -4502,20 +4519,20 @@ | |
| 4519 | ** of these routines, a default value is returned. The default value |
| 4520 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4521 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4522 | ** [SQLITE_NOMEM].)^ |
| 4523 | */ |
| 4524 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol); |
| 4525 | SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); |
| 4526 | SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); |
| 4527 | SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol); |
| 4528 | SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol); |
| 4529 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol); |
| 4530 | SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol); |
| 4531 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 4532 | SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol); |
| 4533 | SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol); |
| 4534 | |
| 4535 | /* |
| 4536 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4537 | ** DESTRUCTOR: sqlite3_stmt |
| 4538 | ** |
| @@ -4539,11 +4556,11 @@ | |
| 4556 | ** resource leaks. It is a grievous error for the application to try to use |
| 4557 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4558 | ** statement after it has been finalized can result in undefined and |
| 4559 | ** undesirable behavior such as segfaults and heap corruption. |
| 4560 | */ |
| 4561 | SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt); |
| 4562 | |
| 4563 | /* |
| 4564 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4565 | ** METHOD: sqlite3_stmt |
| 4566 | ** |
| @@ -4566,11 +4583,11 @@ | |
| 4583 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4584 | ** |
| 4585 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4586 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4587 | */ |
| 4588 | SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt); |
| 4589 | |
| 4590 | /* |
| 4591 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4592 | ** KEYWORDS: {function creation routines} |
| 4593 | ** KEYWORDS: {application-defined SQL function} |
| @@ -4666,40 +4683,40 @@ | |
| 4683 | ** ^An application-defined function is permitted to call other |
| 4684 | ** SQLite interfaces. However, such calls must not |
| 4685 | ** close the database connection nor finalize or reset the prepared |
| 4686 | ** statement in which the function is running. |
| 4687 | */ |
| 4688 | SQLITE_API int SQLITE_APICALL sqlite3_create_function( |
| 4689 | sqlite3 *db, |
| 4690 | const char *zFunctionName, |
| 4691 | int nArg, |
| 4692 | int eTextRep, |
| 4693 | void *pApp, |
| 4694 | void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4695 | void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4696 | void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) |
| 4697 | ); |
| 4698 | SQLITE_API int SQLITE_APICALL sqlite3_create_function16( |
| 4699 | sqlite3 *db, |
| 4700 | const void *zFunctionName, |
| 4701 | int nArg, |
| 4702 | int eTextRep, |
| 4703 | void *pApp, |
| 4704 | void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4705 | void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4706 | void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) |
| 4707 | ); |
| 4708 | SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2( |
| 4709 | sqlite3 *db, |
| 4710 | const char *zFunctionName, |
| 4711 | int nArg, |
| 4712 | int eTextRep, |
| 4713 | void *pApp, |
| 4714 | void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4715 | void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4716 | void (SQLITE_CALLBACK *xFinal)(sqlite3_context*), |
| 4717 | void(SQLITE_CALLBACK *xDestroy)(void*) |
| 4718 | ); |
| 4719 | |
| 4720 | /* |
| 4721 | ** CAPI3REF: Text Encodings |
| 4722 | ** |
| @@ -4732,16 +4749,16 @@ | |
| 4749 | ** to be supported. However, new applications should avoid |
| 4750 | ** the use of these functions. To encourage programmers to avoid |
| 4751 | ** these functions, we will not explain what they do. |
| 4752 | */ |
| 4753 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4754 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*); |
| 4755 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*); |
| 4756 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); |
| 4757 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void); |
| 4758 | SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void); |
| 4759 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int), |
| 4760 | void*,sqlite3_int64); |
| 4761 | #endif |
| 4762 | |
| 4763 | /* |
| 4764 | ** CAPI3REF: Obtaining SQL Values |
| @@ -4787,22 +4804,22 @@ | |
| 4804 | ** or [sqlite3_value_text16()]. |
| 4805 | ** |
| 4806 | ** These routines must be called from the same thread as |
| 4807 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4808 | */ |
| 4809 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*); |
| 4810 | SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*); |
| 4811 | SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*); |
| 4812 | SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*); |
| 4813 | SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*); |
| 4814 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*); |
| 4815 | SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*); |
| 4816 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*); |
| 4817 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*); |
| 4818 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*); |
| 4819 | SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*); |
| 4820 | SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*); |
| 4821 | |
| 4822 | /* |
| 4823 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4824 | ** METHOD: sqlite3_value |
| 4825 | ** |
| @@ -4814,11 +4831,11 @@ | |
| 4831 | ** |
| 4832 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4833 | ** from the result of one [application-defined SQL function] into the |
| 4834 | ** input of another. |
| 4835 | */ |
| 4836 | SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*); |
| 4837 | |
| 4838 | /* |
| 4839 | ** CAPI3REF: Copy And Free SQL Values |
| 4840 | ** METHOD: sqlite3_value |
| 4841 | ** |
| @@ -4830,12 +4847,12 @@ | |
| 4847 | ** |
| 4848 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4849 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4850 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4851 | */ |
| 4852 | SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*); |
| 4853 | SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*); |
| 4854 | |
| 4855 | /* |
| 4856 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4857 | ** METHOD: sqlite3_context |
| 4858 | ** |
| @@ -4876,11 +4893,11 @@ | |
| 4893 | ** function. |
| 4894 | ** |
| 4895 | ** This routine must be called from the same thread in which |
| 4896 | ** the aggregate SQL function is running. |
| 4897 | */ |
| 4898 | SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); |
| 4899 | |
| 4900 | /* |
| 4901 | ** CAPI3REF: User Data For Functions |
| 4902 | ** METHOD: sqlite3_context |
| 4903 | ** |
| @@ -4891,11 +4908,11 @@ | |
| 4908 | ** registered the application defined function. |
| 4909 | ** |
| 4910 | ** This routine must be called from the same thread in which |
| 4911 | ** the application-defined function is running. |
| 4912 | */ |
| 4913 | SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*); |
| 4914 | |
| 4915 | /* |
| 4916 | ** CAPI3REF: Database Connection For Functions |
| 4917 | ** METHOD: sqlite3_context |
| 4918 | ** |
| @@ -4903,11 +4920,11 @@ | |
| 4920 | ** the pointer to the [database connection] (the 1st parameter) |
| 4921 | ** of the [sqlite3_create_function()] |
| 4922 | ** and [sqlite3_create_function16()] routines that originally |
| 4923 | ** registered the application defined function. |
| 4924 | */ |
| 4925 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*); |
| 4926 | |
| 4927 | /* |
| 4928 | ** CAPI3REF: Function Auxiliary Data |
| 4929 | ** METHOD: sqlite3_context |
| 4930 | ** |
| @@ -4956,12 +4973,12 @@ | |
| 4973 | ** values and [parameters] and expressions composed from the same.)^ |
| 4974 | ** |
| 4975 | ** These routines must be called from the same thread in which |
| 4976 | ** the SQL function is running. |
| 4977 | */ |
| 4978 | SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4979 | SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*)); |
| 4980 | |
| 4981 | |
| 4982 | /* |
| 4983 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 4984 | ** |
| @@ -4974,11 +4991,11 @@ | |
| 4991 | ** the content before returning. |
| 4992 | ** |
| 4993 | ** The typedef is necessary to work around problems in certain |
| 4994 | ** C++ compilers. |
| 4995 | */ |
| 4996 | typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); |
| 4997 | #define SQLITE_STATIC ((sqlite3_destructor_type)0) |
| 4998 | #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) |
| 4999 | |
| 5000 | /* |
| 5001 | ** CAPI3REF: Setting The Result Of An SQL Function |
| @@ -5093,31 +5110,31 @@ | |
| 5110 | ** |
| 5111 | ** If these routines are called from within the different thread |
| 5112 | ** than the one containing the application-defined function that received |
| 5113 | ** the [sqlite3_context] pointer, the results are undefined. |
| 5114 | */ |
| 5115 | SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); |
| 5116 | SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*, |
| 5117 | sqlite3_uint64,void(SQLITE_CALLBACK *)(void*)); |
| 5118 | SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double); |
| 5119 | SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int); |
| 5120 | SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int); |
| 5121 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*); |
| 5122 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*); |
| 5123 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int); |
| 5124 | SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int); |
| 5125 | SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); |
| 5126 | SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*); |
| 5127 | SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*)); |
| 5128 | SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, |
| 5129 | void(SQLITE_CALLBACK *)(void*), unsigned char encoding); |
| 5130 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); |
| 5131 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); |
| 5132 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); |
| 5133 | SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 5134 | SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 5135 | SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); |
| 5136 | |
| 5137 | |
| 5138 | /* |
| 5139 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 5140 | ** METHOD: sqlite3_context |
| @@ -5128,11 +5145,11 @@ | |
| 5145 | ** of the subtype T are preserved in current versions of SQLite; |
| 5146 | ** higher order bits are discarded. |
| 5147 | ** The number of subtype bytes preserved by SQLite might increase |
| 5148 | ** in future releases of SQLite. |
| 5149 | */ |
| 5150 | SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int); |
| 5151 | |
| 5152 | /* |
| 5153 | ** CAPI3REF: Define New Collating Sequences |
| 5154 | ** METHOD: sqlite3 |
| 5155 | ** |
| @@ -5210,31 +5227,31 @@ | |
| 5227 | ** is unfortunate but cannot be changed without breaking backwards |
| 5228 | ** compatibility. |
| 5229 | ** |
| 5230 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 5231 | */ |
| 5232 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation( |
| 5233 | sqlite3*, |
| 5234 | const char *zName, |
| 5235 | int eTextRep, |
| 5236 | void *pArg, |
| 5237 | int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) |
| 5238 | ); |
| 5239 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2( |
| 5240 | sqlite3*, |
| 5241 | const char *zName, |
| 5242 | int eTextRep, |
| 5243 | void *pArg, |
| 5244 | int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*), |
| 5245 | void(SQLITE_CALLBACK *xDestroy)(void*) |
| 5246 | ); |
| 5247 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation16( |
| 5248 | sqlite3*, |
| 5249 | const void *zName, |
| 5250 | int eTextRep, |
| 5251 | void *pArg, |
| 5252 | int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) |
| 5253 | ); |
| 5254 | |
| 5255 | /* |
| 5256 | ** CAPI3REF: Collation Needed Callbacks |
| 5257 | ** METHOD: sqlite3 |
| @@ -5260,19 +5277,19 @@ | |
| 5277 | ** |
| 5278 | ** The callback function should register the desired collation using |
| 5279 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5280 | ** [sqlite3_create_collation_v2()]. |
| 5281 | */ |
| 5282 | SQLITE_API int SQLITE_APICALL sqlite3_collation_needed( |
| 5283 | sqlite3*, |
| 5284 | void*, |
| 5285 | void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*) |
| 5286 | ); |
| 5287 | SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16( |
| 5288 | sqlite3*, |
| 5289 | void*, |
| 5290 | void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*) |
| 5291 | ); |
| 5292 | |
| 5293 | #ifdef SQLITE_HAS_CODEC |
| 5294 | /* |
| 5295 | ** Specify the key for an encrypted database. This routine should be |
| @@ -5279,15 +5296,15 @@ | |
| 5296 | ** called right after sqlite3_open(). |
| 5297 | ** |
| 5298 | ** The code to implement this API is not available in the public release |
| 5299 | ** of SQLite. |
| 5300 | */ |
| 5301 | SQLITE_API int SQLITE_APICALL sqlite3_key( |
| 5302 | sqlite3 *db, /* Database to be rekeyed */ |
| 5303 | const void *pKey, int nKey /* The key */ |
| 5304 | ); |
| 5305 | SQLITE_API int SQLITE_APICALL sqlite3_key_v2( |
| 5306 | sqlite3 *db, /* Database to be rekeyed */ |
| 5307 | const char *zDbName, /* Name of the database */ |
| 5308 | const void *pKey, int nKey /* The key */ |
| 5309 | ); |
| 5310 | |
| @@ -5297,35 +5314,35 @@ | |
| 5314 | ** database is decrypted. |
| 5315 | ** |
| 5316 | ** The code to implement this API is not available in the public release |
| 5317 | ** of SQLite. |
| 5318 | */ |
| 5319 | SQLITE_API int SQLITE_APICALL sqlite3_rekey( |
| 5320 | sqlite3 *db, /* Database to be rekeyed */ |
| 5321 | const void *pKey, int nKey /* The new key */ |
| 5322 | ); |
| 5323 | SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2( |
| 5324 | sqlite3 *db, /* Database to be rekeyed */ |
| 5325 | const char *zDbName, /* Name of the database */ |
| 5326 | const void *pKey, int nKey /* The new key */ |
| 5327 | ); |
| 5328 | |
| 5329 | /* |
| 5330 | ** Specify the activation key for a SEE database. Unless |
| 5331 | ** activated, none of the SEE routines will work. |
| 5332 | */ |
| 5333 | SQLITE_API void SQLITE_APICALL sqlite3_activate_see( |
| 5334 | const char *zPassPhrase /* Activation phrase */ |
| 5335 | ); |
| 5336 | #endif |
| 5337 | |
| 5338 | #ifdef SQLITE_ENABLE_CEROD |
| 5339 | /* |
| 5340 | ** Specify the activation key for a CEROD database. Unless |
| 5341 | ** activated, none of the CEROD routines will work. |
| 5342 | */ |
| 5343 | SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod( |
| 5344 | const char *zPassPhrase /* Activation phrase */ |
| 5345 | ); |
| 5346 | #endif |
| 5347 | |
| 5348 | /* |
| @@ -5343,11 +5360,11 @@ | |
| 5360 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5361 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5362 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5363 | ** in the previous paragraphs. |
| 5364 | */ |
| 5365 | SQLITE_API int SQLITE_APICALL sqlite3_sleep(int); |
| 5366 | |
| 5367 | /* |
| 5368 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5369 | ** |
| 5370 | ** ^(If this global variable is made to point to a string which is |
| @@ -5462,11 +5479,11 @@ | |
| 5479 | ** |
| 5480 | ** If another thread changes the autocommit status of the database |
| 5481 | ** connection while this routine is running, then the return value |
| 5482 | ** is undefined. |
| 5483 | */ |
| 5484 | SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*); |
| 5485 | |
| 5486 | /* |
| 5487 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5488 | ** METHOD: sqlite3_stmt |
| 5489 | ** |
| @@ -5475,11 +5492,11 @@ | |
| 5492 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5493 | ** that was the first argument |
| 5494 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5495 | ** create the statement in the first place. |
| 5496 | */ |
| 5497 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*); |
| 5498 | |
| 5499 | /* |
| 5500 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5501 | ** METHOD: sqlite3 |
| 5502 | ** |
| @@ -5492,21 +5509,21 @@ | |
| 5509 | ** ^The filename returned by this function is the output of the |
| 5510 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5511 | ** will be an absolute pathname, even if the filename used |
| 5512 | ** to open the database originally was a URI or relative pathname. |
| 5513 | */ |
| 5514 | SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 5515 | |
| 5516 | /* |
| 5517 | ** CAPI3REF: Determine if a database is read-only |
| 5518 | ** METHOD: sqlite3 |
| 5519 | ** |
| 5520 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5521 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5522 | ** the name of a database on connection D. |
| 5523 | */ |
| 5524 | SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); |
| 5525 | |
| 5526 | /* |
| 5527 | ** CAPI3REF: Find the next prepared statement |
| 5528 | ** METHOD: sqlite3 |
| 5529 | ** |
| @@ -5518,11 +5535,11 @@ | |
| 5535 | ** |
| 5536 | ** The [database connection] pointer D in a call to |
| 5537 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5538 | ** connection and in particular must not be a NULL pointer. |
| 5539 | */ |
| 5540 | SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); |
| 5541 | |
| 5542 | /* |
| 5543 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5544 | ** METHOD: sqlite3 |
| 5545 | ** |
| @@ -5567,12 +5584,12 @@ | |
| 5584 | ** ^The rollback callback is not invoked if a transaction is |
| 5585 | ** automatically rolled back because the database connection is closed. |
| 5586 | ** |
| 5587 | ** See also the [sqlite3_update_hook()] interface. |
| 5588 | */ |
| 5589 | SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*); |
| 5590 | SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); |
| 5591 | |
| 5592 | /* |
| 5593 | ** CAPI3REF: Data Change Notification Callbacks |
| 5594 | ** METHOD: sqlite3 |
| 5595 | ** |
| @@ -5619,13 +5636,13 @@ | |
| 5636 | ** the first call on D. |
| 5637 | ** |
| 5638 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5639 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5640 | */ |
| 5641 | SQLITE_API void *SQLITE_APICALL sqlite3_update_hook( |
| 5642 | sqlite3*, |
| 5643 | void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64), |
| 5644 | void* |
| 5645 | ); |
| 5646 | |
| 5647 | /* |
| 5648 | ** CAPI3REF: Enable Or Disable Shared Pager Cache |
| @@ -5659,11 +5676,11 @@ | |
| 5676 | ** This interface is threadsafe on processors where writing a |
| 5677 | ** 32-bit integer is atomic. |
| 5678 | ** |
| 5679 | ** See Also: [SQLite Shared-Cache Mode] |
| 5680 | */ |
| 5681 | SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int); |
| 5682 | |
| 5683 | /* |
| 5684 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5685 | ** |
| 5686 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| @@ -5675,11 +5692,11 @@ | |
| 5692 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5693 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5694 | ** |
| 5695 | ** See also: [sqlite3_db_release_memory()] |
| 5696 | */ |
| 5697 | SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int); |
| 5698 | |
| 5699 | /* |
| 5700 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5701 | ** METHOD: sqlite3 |
| 5702 | ** |
| @@ -5689,11 +5706,11 @@ | |
| 5706 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5707 | ** omitted. |
| 5708 | ** |
| 5709 | ** See also: [sqlite3_release_memory()] |
| 5710 | */ |
| 5711 | SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*); |
| 5712 | |
| 5713 | /* |
| 5714 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5715 | ** |
| 5716 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| @@ -5741,11 +5758,11 @@ | |
| 5758 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5759 | ** |
| 5760 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5761 | ** changes in future releases of SQLite. |
| 5762 | */ |
| 5763 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 5764 | |
| 5765 | /* |
| 5766 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5767 | ** DEPRECATED |
| 5768 | ** |
| @@ -5752,11 +5769,11 @@ | |
| 5769 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5770 | ** interface. This routine is provided for historical compatibility |
| 5771 | ** only. All new applications should use the |
| 5772 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5773 | */ |
| 5774 | SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N); |
| 5775 | |
| 5776 | |
| 5777 | /* |
| 5778 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5779 | ** METHOD: sqlite3 |
| @@ -5822,11 +5839,11 @@ | |
| 5839 | ** |
| 5840 | ** ^This function causes all database schemas to be read from disk and |
| 5841 | ** parsed, if that has not already been done, and returns an error if |
| 5842 | ** any errors are encountered while loading the schema. |
| 5843 | */ |
| 5844 | SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata( |
| 5845 | sqlite3 *db, /* Connection handle */ |
| 5846 | const char *zDbName, /* Database name or NULL */ |
| 5847 | const char *zTableName, /* Table name */ |
| 5848 | const char *zColumnName, /* Column name */ |
| 5849 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -5878,11 +5895,11 @@ | |
| 5895 | ** disabled and prevent SQL injections from giving attackers |
| 5896 | ** access to extension loading capabilities. |
| 5897 | ** |
| 5898 | ** See also the [load_extension() SQL function]. |
| 5899 | */ |
| 5900 | SQLITE_API int SQLITE_APICALL sqlite3_load_extension( |
| 5901 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5902 | const char *zFile, /* Name of the shared library containing extension */ |
| 5903 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5904 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5905 | ); |
| @@ -5910,11 +5927,11 @@ | |
| 5927 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5928 | ** rather than this interface, so the [load_extension()] SQL function |
| 5929 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5930 | ** access to extension loading capabilities. |
| 5931 | */ |
| 5932 | SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); |
| 5933 | |
| 5934 | /* |
| 5935 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5936 | ** |
| 5937 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| @@ -5948,11 +5965,14 @@ | |
| 5965 | ** will be called more than once for each database connection that is opened. |
| 5966 | ** |
| 5967 | ** See also: [sqlite3_reset_auto_extension()] |
| 5968 | ** and [sqlite3_cancel_auto_extension()] |
| 5969 | */ |
| 5970 | typedef struct sqlite3_api_routines sqlite3_api_routines; |
| 5971 | SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( |
| 5972 | int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 5973 | ); |
| 5974 | |
| 5975 | /* |
| 5976 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5977 | ** |
| 5978 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| @@ -5960,19 +5980,21 @@ | |
| 5980 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5981 | ** routine returns 1 if initialization routine X was successfully |
| 5982 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5983 | ** routines. |
| 5984 | */ |
| 5985 | SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( |
| 5986 | int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 5987 | ); |
| 5988 | |
| 5989 | /* |
| 5990 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5991 | ** |
| 5992 | ** ^This interface disables all automatic extensions previously |
| 5993 | ** registered using [sqlite3_auto_extension()]. |
| 5994 | */ |
| 5995 | SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void); |
| 5996 | |
| 5997 | /* |
| 5998 | ** The interface to the virtual-table mechanism is currently considered |
| 5999 | ** to be experimental. The interface might change in incompatible ways. |
| 6000 | ** If this is a problem for you, do not use the interface at this time. |
| @@ -6005,41 +6027,41 @@ | |
| 6027 | ** of this structure must not change while it is registered with |
| 6028 | ** any database connection. |
| 6029 | */ |
| 6030 | struct sqlite3_module { |
| 6031 | int iVersion; |
| 6032 | int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux, |
| 6033 | int argc, const char *const*argv, |
| 6034 | sqlite3_vtab **ppVTab, char**); |
| 6035 | int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux, |
| 6036 | int argc, const char *const*argv, |
| 6037 | sqlite3_vtab **ppVTab, char**); |
| 6038 | int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); |
| 6039 | int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab); |
| 6040 | int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab); |
| 6041 | int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); |
| 6042 | int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*); |
| 6043 | int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, |
| 6044 | int argc, sqlite3_value **argv); |
| 6045 | int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*); |
| 6046 | int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*); |
| 6047 | int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); |
| 6048 | int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); |
| 6049 | int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); |
| 6050 | int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab); |
| 6051 | int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab); |
| 6052 | int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab); |
| 6053 | int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab); |
| 6054 | int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, |
| 6055 | void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**), |
| 6056 | void **ppArg); |
| 6057 | int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew); |
| 6058 | /* The methods above are in version 1 of the sqlite_module object. Those |
| 6059 | ** below are for version 2 and greater. */ |
| 6060 | int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int); |
| 6061 | int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int); |
| 6062 | int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int); |
| 6063 | }; |
| 6064 | |
| 6065 | /* |
| 6066 | ** CAPI3REF: Virtual Table Indexing Information |
| 6067 | ** KEYWORDS: sqlite3_index_info |
| @@ -6213,22 +6235,22 @@ | |
| 6235 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 6236 | ** ^The sqlite3_create_module() |
| 6237 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 6238 | ** destructor. |
| 6239 | */ |
| 6240 | SQLITE_API int SQLITE_APICALL sqlite3_create_module( |
| 6241 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6242 | const char *zName, /* Name of the module */ |
| 6243 | const sqlite3_module *p, /* Methods for the module */ |
| 6244 | void *pClientData /* Client data for xCreate/xConnect */ |
| 6245 | ); |
| 6246 | SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2( |
| 6247 | sqlite3 *db, /* SQLite connection to register module with */ |
| 6248 | const char *zName, /* Name of the module */ |
| 6249 | const sqlite3_module *p, /* Methods for the module */ |
| 6250 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 6251 | void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */ |
| 6252 | ); |
| 6253 | |
| 6254 | /* |
| 6255 | ** CAPI3REF: Virtual Table Instance Object |
| 6256 | ** KEYWORDS: sqlite3_vtab |
| @@ -6282,11 +6304,11 @@ | |
| 6304 | ** ^The [xCreate] and [xConnect] methods of a |
| 6305 | ** [virtual table module] call this interface |
| 6306 | ** to declare the format (the names and datatypes of the columns) of |
| 6307 | ** the virtual tables they implement. |
| 6308 | */ |
| 6309 | SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); |
| 6310 | |
| 6311 | /* |
| 6312 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6313 | ** METHOD: sqlite3 |
| 6314 | ** |
| @@ -6301,11 +6323,11 @@ | |
| 6323 | ** of the new function always causes an exception to be thrown. So |
| 6324 | ** the new function is not good for anything by itself. Its only |
| 6325 | ** purpose is to be a placeholder function that can be overloaded |
| 6326 | ** by a [virtual table]. |
| 6327 | */ |
| 6328 | SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 6329 | |
| 6330 | /* |
| 6331 | ** The interface to the virtual-table mechanism defined above (back up |
| 6332 | ** to a comment remarkably similar to this one) is currently considered |
| 6333 | ** to be experimental. The interface might change in incompatible ways. |
| @@ -6400,11 +6422,11 @@ | |
| 6422 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6423 | ** |
| 6424 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6425 | ** be released by a call to [sqlite3_blob_close()]. |
| 6426 | */ |
| 6427 | SQLITE_API int SQLITE_APICALL sqlite3_blob_open( |
| 6428 | sqlite3*, |
| 6429 | const char *zDb, |
| 6430 | const char *zTable, |
| 6431 | const char *zColumn, |
| 6432 | sqlite3_int64 iRow, |
| @@ -6433,11 +6455,11 @@ | |
| 6455 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6456 | ** always returns zero. |
| 6457 | ** |
| 6458 | ** ^This function sets the database handle error code and message. |
| 6459 | */ |
| 6460 | SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); |
| 6461 | |
| 6462 | /* |
| 6463 | ** CAPI3REF: Close A BLOB Handle |
| 6464 | ** DESTRUCTOR: sqlite3_blob |
| 6465 | ** |
| @@ -6456,11 +6478,11 @@ | |
| 6478 | ** with a null pointer (such as would be returned by a failed call to |
| 6479 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6480 | ** is passed a valid open blob handle, the values returned by the |
| 6481 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6482 | */ |
| 6483 | SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *); |
| 6484 | |
| 6485 | /* |
| 6486 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6487 | ** METHOD: sqlite3_blob |
| 6488 | ** |
| @@ -6472,11 +6494,11 @@ | |
| 6494 | ** This routine only works on a [BLOB handle] which has been created |
| 6495 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6496 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6497 | ** to this routine results in undefined and probably undesirable behavior. |
| 6498 | */ |
| 6499 | SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *); |
| 6500 | |
| 6501 | /* |
| 6502 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6503 | ** METHOD: sqlite3_blob |
| 6504 | ** |
| @@ -6501,11 +6523,11 @@ | |
| 6523 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6524 | ** to this routine results in undefined and probably undesirable behavior. |
| 6525 | ** |
| 6526 | ** See also: [sqlite3_blob_write()]. |
| 6527 | */ |
| 6528 | SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); |
| 6529 | |
| 6530 | /* |
| 6531 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6532 | ** METHOD: sqlite3_blob |
| 6533 | ** |
| @@ -6543,11 +6565,11 @@ | |
| 6565 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6566 | ** to this routine results in undefined and probably undesirable behavior. |
| 6567 | ** |
| 6568 | ** See also: [sqlite3_blob_read()]. |
| 6569 | */ |
| 6570 | SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); |
| 6571 | |
| 6572 | /* |
| 6573 | ** CAPI3REF: Virtual File System Objects |
| 6574 | ** |
| 6575 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| @@ -6574,13 +6596,13 @@ | |
| 6596 | ** |
| 6597 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6598 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6599 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6600 | */ |
| 6601 | SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName); |
| 6602 | SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); |
| 6603 | SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*); |
| 6604 | |
| 6605 | /* |
| 6606 | ** CAPI3REF: Mutexes |
| 6607 | ** |
| 6608 | ** The SQLite core uses these routines for thread |
| @@ -6692,15 +6714,15 @@ | |
| 6714 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6715 | ** behave as no-ops. |
| 6716 | ** |
| 6717 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6718 | */ |
| 6719 | SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int); |
| 6720 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*); |
| 6721 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*); |
| 6722 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*); |
| 6723 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*); |
| 6724 | |
| 6725 | /* |
| 6726 | ** CAPI3REF: Mutex Methods Object |
| 6727 | ** |
| 6728 | ** An instance of this structure defines the low-level routines |
| @@ -6765,19 +6787,19 @@ | |
| 6787 | ** If xMutexInit fails in any way, it is expected to clean up after itself |
| 6788 | ** prior to returning. |
| 6789 | */ |
| 6790 | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; |
| 6791 | struct sqlite3_mutex_methods { |
| 6792 | int (SQLITE_CALLBACK *xMutexInit)(void); |
| 6793 | int (SQLITE_CALLBACK *xMutexEnd)(void); |
| 6794 | sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int); |
| 6795 | void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *); |
| 6796 | void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *); |
| 6797 | int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *); |
| 6798 | void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *); |
| 6799 | int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *); |
| 6800 | int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *); |
| 6801 | }; |
| 6802 | |
| 6803 | /* |
| 6804 | ** CAPI3REF: Mutex Verification Routines |
| 6805 | ** |
| @@ -6806,12 +6828,12 @@ | |
| 6828 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6829 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6830 | ** interface should also return 1 when given a NULL pointer. |
| 6831 | */ |
| 6832 | #ifndef NDEBUG |
| 6833 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*); |
| 6834 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*); |
| 6835 | #endif |
| 6836 | |
| 6837 | /* |
| 6838 | ** CAPI3REF: Mutex Types |
| 6839 | ** |
| @@ -6847,11 +6869,11 @@ | |
| 6869 | ** serializes access to the [database connection] given in the argument |
| 6870 | ** when the [threading mode] is Serialized. |
| 6871 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6872 | ** routine returns a NULL pointer. |
| 6873 | */ |
| 6874 | SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*); |
| 6875 | |
| 6876 | /* |
| 6877 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6878 | ** METHOD: sqlite3 |
| 6879 | ** |
| @@ -6882,11 +6904,11 @@ | |
| 6904 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6905 | ** xFileControl method. |
| 6906 | ** |
| 6907 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6908 | */ |
| 6909 | SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); |
| 6910 | |
| 6911 | /* |
| 6912 | ** CAPI3REF: Testing Interface |
| 6913 | ** |
| 6914 | ** ^The sqlite3_test_control() interface is used to read out internal |
| @@ -6964,12 +6986,12 @@ | |
| 6986 | ** be represented by a 32-bit integer, then the values returned by |
| 6987 | ** sqlite3_status() are undefined. |
| 6988 | ** |
| 6989 | ** See also: [sqlite3_db_status()] |
| 6990 | */ |
| 6991 | SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); |
| 6992 | SQLITE_API int SQLITE_APICALL sqlite3_status64( |
| 6993 | int op, |
| 6994 | sqlite3_int64 *pCurrent, |
| 6995 | sqlite3_int64 *pHighwater, |
| 6996 | int resetFlag |
| 6997 | ); |
| @@ -7090,11 +7112,11 @@ | |
| 7112 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 7113 | ** non-zero [error code] on failure. |
| 7114 | ** |
| 7115 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 7116 | */ |
| 7117 | SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); |
| 7118 | |
| 7119 | /* |
| 7120 | ** CAPI3REF: Status Parameters for database connections |
| 7121 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 7122 | ** |
| @@ -7233,11 +7255,11 @@ | |
| 7255 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 7256 | ** interface call returns. |
| 7257 | ** |
| 7258 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 7259 | */ |
| 7260 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); |
| 7261 | |
| 7262 | /* |
| 7263 | ** CAPI3REF: Status Parameters for prepared statements |
| 7264 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 7265 | ** |
| @@ -7469,22 +7491,22 @@ | |
| 7491 | */ |
| 7492 | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; |
| 7493 | struct sqlite3_pcache_methods2 { |
| 7494 | int iVersion; |
| 7495 | void *pArg; |
| 7496 | int (SQLITE_CALLBACK *xInit)(void*); |
| 7497 | void (SQLITE_CALLBACK *xShutdown)(void*); |
| 7498 | sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable); |
| 7499 | void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7500 | int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); |
| 7501 | sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7502 | void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); |
| 7503 | void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, |
| 7504 | unsigned oldKey, unsigned newKey); |
| 7505 | void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7506 | void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); |
| 7507 | void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*); |
| 7508 | }; |
| 7509 | |
| 7510 | /* |
| 7511 | ** This is the obsolete pcache_methods object that has now been replaced |
| 7512 | ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is |
| @@ -7491,20 +7513,20 @@ | |
| 7513 | ** retained in the header file for backwards compatibility only. |
| 7514 | */ |
| 7515 | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; |
| 7516 | struct sqlite3_pcache_methods { |
| 7517 | void *pArg; |
| 7518 | int (SQLITE_CALLBACK *xInit)(void*); |
| 7519 | void (SQLITE_CALLBACK *xShutdown)(void*); |
| 7520 | sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable); |
| 7521 | void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7522 | int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); |
| 7523 | void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7524 | void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard); |
| 7525 | void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); |
| 7526 | void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7527 | void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); |
| 7528 | }; |
| 7529 | |
| 7530 | |
| 7531 | /* |
| 7532 | ** CAPI3REF: Online Backup Object |
| @@ -7702,20 +7724,20 @@ | |
| 7724 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7725 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7726 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7727 | ** possible that they return invalid values. |
| 7728 | */ |
| 7729 | SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init( |
| 7730 | sqlite3 *pDest, /* Destination database handle */ |
| 7731 | const char *zDestName, /* Destination database name */ |
| 7732 | sqlite3 *pSource, /* Source database handle */ |
| 7733 | const char *zSourceName /* Source database name */ |
| 7734 | ); |
| 7735 | SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage); |
| 7736 | SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p); |
| 7737 | SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p); |
| 7738 | SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p); |
| 7739 | |
| 7740 | /* |
| 7741 | ** CAPI3REF: Unlock Notification |
| 7742 | ** METHOD: sqlite3 |
| 7743 | ** |
| @@ -7828,13 +7850,13 @@ | |
| 7850 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7851 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7852 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7853 | ** SQLITE_LOCKED.)^ |
| 7854 | */ |
| 7855 | SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify( |
| 7856 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7857 | void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */ |
| 7858 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7859 | ); |
| 7860 | |
| 7861 | |
| 7862 | /* |
| @@ -7843,12 +7865,12 @@ | |
| 7865 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7866 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7867 | ** strings in a case-independent fashion, using the same definition of "case |
| 7868 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7869 | */ |
| 7870 | SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *); |
| 7871 | SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int); |
| 7872 | |
| 7873 | /* |
| 7874 | ** CAPI3REF: String Globbing |
| 7875 | * |
| 7876 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| @@ -7861,11 +7883,11 @@ | |
| 7883 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7884 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7885 | ** |
| 7886 | ** See also: [sqlite3_strlike()]. |
| 7887 | */ |
| 7888 | SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr); |
| 7889 | |
| 7890 | /* |
| 7891 | ** CAPI3REF: String LIKE Matching |
| 7892 | * |
| 7893 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| @@ -7884,11 +7906,11 @@ | |
| 7906 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7907 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7908 | ** |
| 7909 | ** See also: [sqlite3_strglob()]. |
| 7910 | */ |
| 7911 | SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); |
| 7912 | |
| 7913 | /* |
| 7914 | ** CAPI3REF: Error Logging Interface |
| 7915 | ** |
| 7916 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| @@ -7943,13 +7965,13 @@ | |
| 7965 | ** previously registered write-ahead log callback. ^Note that the |
| 7966 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7967 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7968 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7969 | */ |
| 7970 | SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook( |
| 7971 | sqlite3*, |
| 7972 | int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int), |
| 7973 | void* |
| 7974 | ); |
| 7975 | |
| 7976 | /* |
| 7977 | ** CAPI3REF: Configure an auto-checkpoint |
| @@ -7978,11 +8000,11 @@ | |
| 8000 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 8001 | ** pages. The use of this interface |
| 8002 | ** is only necessary if the default setting is found to be suboptimal |
| 8003 | ** for a particular application. |
| 8004 | */ |
| 8005 | SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); |
| 8006 | |
| 8007 | /* |
| 8008 | ** CAPI3REF: Checkpoint a database |
| 8009 | ** METHOD: sqlite3 |
| 8010 | ** |
| @@ -8000,11 +8022,11 @@ | |
| 8022 | ** interface was added. This interface is retained for backwards |
| 8023 | ** compatibility and as a convenience for applications that need to manually |
| 8024 | ** start a callback but which do not need the full power (and corresponding |
| 8025 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 8026 | */ |
| 8027 | SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); |
| 8028 | |
| 8029 | /* |
| 8030 | ** CAPI3REF: Checkpoint a database |
| 8031 | ** METHOD: sqlite3 |
| 8032 | ** |
| @@ -8094,11 +8116,11 @@ | |
| 8116 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 8117 | ** |
| 8118 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 8119 | ** from SQL. |
| 8120 | */ |
| 8121 | SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2( |
| 8122 | sqlite3 *db, /* Database handle */ |
| 8123 | const char *zDb, /* Name of attached database (or NULL) */ |
| 8124 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 8125 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 8126 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -8183,11 +8205,11 @@ | |
| 8205 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 8206 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 8207 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 8208 | ** [virtual table]. |
| 8209 | */ |
| 8210 | SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *); |
| 8211 | |
| 8212 | /* |
| 8213 | ** CAPI3REF: Conflict resolution modes |
| 8214 | ** KEYWORDS: {conflict resolution mode} |
| 8215 | ** |
| @@ -8288,11 +8310,11 @@ | |
| 8310 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8311 | ** that pOut points to unchanged. |
| 8312 | ** |
| 8313 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8314 | */ |
| 8315 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus( |
| 8316 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8317 | int idx, /* Index of loop to report on */ |
| 8318 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8319 | void *pOut /* Result written here */ |
| 8320 | ); |
| @@ -8304,11 +8326,11 @@ | |
| 8326 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8327 | ** |
| 8328 | ** This API is only available if the library is built with pre-processor |
| 8329 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8330 | */ |
| 8331 | SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); |
| 8332 | |
| 8333 | /* |
| 8334 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8335 | ** |
| 8336 | ** ^If a write-transaction is open on [database connection] D when the |
| @@ -8336,11 +8358,11 @@ | |
| 8358 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8359 | ** |
| 8360 | ** ^This function does not set the database handle error code or message |
| 8361 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8362 | */ |
| 8363 | SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*); |
| 8364 | |
| 8365 | /* |
| 8366 | ** CAPI3REF: The pre-update hook. |
| 8367 | ** |
| 8368 | ** ^These interfaces are only available if SQLite is compiled using the |
| @@ -8416,13 +8438,13 @@ | |
| 8438 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8439 | ** triggers; and so forth. |
| 8440 | ** |
| 8441 | ** See also: [sqlite3_update_hook()] |
| 8442 | */ |
| 8443 | SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook( |
| 8444 | sqlite3 *db, |
| 8445 | void(SQLITE_CALLBACK *xPreUpdate)( |
| 8446 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8447 | sqlite3 *db, /* Database handle */ |
| 8448 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| 8449 | char const *zDb, /* Database name */ |
| 8450 | char const *zName, /* Table name */ |
| @@ -8429,14 +8451,14 @@ | |
| 8451 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8452 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8453 | ), |
| 8454 | void* |
| 8455 | ); |
| 8456 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); |
| 8457 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *); |
| 8458 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *); |
| 8459 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 8460 | |
| 8461 | /* |
| 8462 | ** CAPI3REF: Low-level system error code |
| 8463 | ** |
| 8464 | ** ^Attempt to return the underlying operating system error code or error |
| @@ -8444,11 +8466,11 @@ | |
| 8466 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8467 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8468 | ** called to get back the underlying "errno" that caused the problem, such |
| 8469 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8470 | */ |
| 8471 | SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*); |
| 8472 | |
| 8473 | /* |
| 8474 | ** CAPI3REF: Database Snapshot |
| 8475 | ** KEYWORDS: {snapshot} |
| 8476 | ** EXPERIMENTAL |
| @@ -8494,11 +8516,11 @@ | |
| 8516 | ** to avoid a memory leak. |
| 8517 | ** |
| 8518 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8519 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8520 | */ |
| 8521 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get( |
| 8522 | sqlite3 *db, |
| 8523 | const char *zSchema, |
| 8524 | sqlite3_snapshot **ppSnapshot |
| 8525 | ); |
| 8526 | |
| @@ -8532,11 +8554,11 @@ | |
| 8554 | ** database connection in order to make it ready to use snapshots.) |
| 8555 | ** |
| 8556 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8557 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8558 | */ |
| 8559 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open( |
| 8560 | sqlite3 *db, |
| 8561 | const char *zSchema, |
| 8562 | sqlite3_snapshot *pSnapshot |
| 8563 | ); |
| 8564 | |
| @@ -8549,11 +8571,11 @@ | |
| 8571 | ** using this routine to avoid a memory leak. |
| 8572 | ** |
| 8573 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8574 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8575 | */ |
| 8576 | SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*); |
| 8577 | |
| 8578 | /* |
| 8579 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8580 | ** EXPERIMENTAL |
| 8581 | ** |
| @@ -8573,11 +8595,11 @@ | |
| 8595 | ** |
| 8596 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8597 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8598 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8599 | */ |
| 8600 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp( |
| 8601 | sqlite3_snapshot *p1, |
| 8602 | sqlite3_snapshot *p2 |
| 8603 | ); |
| 8604 | |
| 8605 | /* |
| @@ -8631,14 +8653,14 @@ | |
| 8653 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8654 | ** R-Tree geometry query as follows: |
| 8655 | ** |
| 8656 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8657 | */ |
| 8658 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback( |
| 8659 | sqlite3 *db, |
| 8660 | const char *zGeom, |
| 8661 | int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), |
| 8662 | void *pContext |
| 8663 | ); |
| 8664 | |
| 8665 | |
| 8666 | /* |
| @@ -8648,25 +8670,25 @@ | |
| 8670 | struct sqlite3_rtree_geometry { |
| 8671 | void *pContext; /* Copy of pContext passed to s_r_g_c() */ |
| 8672 | int nParam; /* Size of array aParam[] */ |
| 8673 | sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ |
| 8674 | void *pUser; /* Callback implementation user data */ |
| 8675 | void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */ |
| 8676 | }; |
| 8677 | |
| 8678 | /* |
| 8679 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8680 | ** used as part of an R-Tree geometry query as follows: |
| 8681 | ** |
| 8682 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8683 | */ |
| 8684 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback( |
| 8685 | sqlite3 *db, |
| 8686 | const char *zQueryFunc, |
| 8687 | int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*), |
| 8688 | void *pContext, |
| 8689 | void (SQLITE_CALLBACK *xDestructor)(void*) |
| 8690 | ); |
| 8691 | |
| 8692 | |
| 8693 | /* |
| 8694 | ** A pointer to a structure of the following type is passed as the |
| @@ -8680,11 +8702,11 @@ | |
| 8702 | struct sqlite3_rtree_query_info { |
| 8703 | void *pContext; /* pContext from when function registered */ |
| 8704 | int nParam; /* Number of function parameters */ |
| 8705 | sqlite3_rtree_dbl *aParam; /* value of function parameters */ |
| 8706 | void *pUser; /* callback can use this, if desired */ |
| 8707 | void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */ |
| 8708 | sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ |
| 8709 | unsigned int *anQueue; /* Number of pending entries in the queue */ |
| 8710 | int nCoord; /* Number of coordinates */ |
| 8711 | int iLevel; /* Level of current node or entry */ |
| 8712 | int mxLevel; /* The largest iLevel value in the tree */ |
| @@ -8876,11 +8898,11 @@ | |
| 8898 | ** If xFilter returns 0, changes is not tracked. Note that once a table is |
| 8899 | ** attached, xFilter will not be called again. |
| 8900 | */ |
| 8901 | void sqlite3session_table_filter( |
| 8902 | sqlite3_session *pSession, /* Session object */ |
| 8903 | int(SQLITE_CALLBACK *xFilter)( |
| 8904 | void *pCtx, /* Copy of third arg to _filter_table() */ |
| 8905 | const char *zTab /* Table name */ |
| 8906 | ), |
| 8907 | void *pCtx /* First argument passed to xFilter */ |
| 8908 | ); |
| @@ -9451,11 +9473,11 @@ | |
| 9473 | ** An sqlite3_changegroup object is used to combine two or more changesets |
| 9474 | ** (or patchsets) into a single changeset (or patchset). A single changegroup |
| 9475 | ** object may combine changesets or patchsets, but not both. The output is |
| 9476 | ** always in the same format as the input. |
| 9477 | ** |
| 9478 | ** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with |
| 9479 | ** a pointer to a new sqlite3_changegroup object before returning. The caller |
| 9480 | ** should eventually free the returned object using a call to |
| 9481 | ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code |
| 9482 | ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. |
| 9483 | ** |
| @@ -9571,11 +9593,11 @@ | |
| 9593 | ** changes for tables that do not appear in the first changeset, they are |
| 9594 | ** appended onto the end of the output changeset, again in the order in |
| 9595 | ** which they are first encountered. |
| 9596 | ** |
| 9597 | ** If an error occurs, an SQLite error code is returned and the output |
| 9598 | ** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK |
| 9599 | ** is returned and the output variables are set to the size of and a |
| 9600 | ** pointer to the output buffer, respectively. In this case it is the |
| 9601 | ** responsibility of the caller to eventually free the buffer using a |
| 9602 | ** call to sqlite3_free(). |
| 9603 | */ |
| @@ -9728,15 +9750,15 @@ | |
| 9750 | */ |
| 9751 | int sqlite3changeset_apply( |
| 9752 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9753 | int nChangeset, /* Size of changeset in bytes */ |
| 9754 | void *pChangeset, /* Changeset blob */ |
| 9755 | int(SQLITE_CALLBACK *xFilter)( |
| 9756 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9757 | const char *zTab /* Table name */ |
| 9758 | ), |
| 9759 | int(SQLITE_CALLBACK *xConflict)( |
| 9760 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9761 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9762 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9763 | ), |
| 9764 | void *pCtx /* First argument passed to xConflict */ |
| @@ -9873,20 +9895,20 @@ | |
| 9895 | ** </pre> |
| 9896 | ** |
| 9897 | ** Is replaced by: |
| 9898 | ** |
| 9899 | ** <pre> |
| 9900 | ** int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9901 | ** void *pIn, |
| 9902 | ** </pre> |
| 9903 | ** |
| 9904 | ** Each time the xInput callback is invoked by the sessions module, the first |
| 9905 | ** argument passed is a copy of the supplied pIn context pointer. The second |
| 9906 | ** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no |
| 9907 | ** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data |
| 9908 | ** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied |
| 9909 | ** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData) |
| 9910 | ** should be set to zero to indicate this. Or, if an error occurs, an SQLite |
| 9911 | ** error code should be returned. In all cases, if an xInput callback returns |
| 9912 | ** an error, all processing is abandoned and the streaming API function |
| 9913 | ** returns a copy of the error code to the caller. |
| 9914 | ** |
| @@ -9907,11 +9929,11 @@ | |
| 9929 | ** </pre> |
| 9930 | ** |
| 9931 | ** Is replaced by: |
| 9932 | ** |
| 9933 | ** <pre> |
| 9934 | ** int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9935 | ** void *pOut |
| 9936 | ** </pre> |
| 9937 | ** |
| 9938 | ** The xOutput callback is invoked zero or more times to return data to |
| 9939 | ** the application. The first parameter passed to each call is a copy of the |
| @@ -9927,58 +9949,58 @@ | |
| 9949 | ** parameter set to a value less than or equal to zero. Other than this, |
| 9950 | ** no guarantees are made as to the size of the chunks of data returned. |
| 9951 | */ |
| 9952 | int sqlite3changeset_apply_strm( |
| 9953 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9954 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 9955 | void *pIn, /* First arg for xInput */ |
| 9956 | int(SQLITE_CALLBACK *xFilter)( |
| 9957 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9958 | const char *zTab /* Table name */ |
| 9959 | ), |
| 9960 | int(SQLITE_CALLBACK *xConflict)( |
| 9961 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9962 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9963 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9964 | ), |
| 9965 | void *pCtx /* First argument passed to xConflict */ |
| 9966 | ); |
| 9967 | int sqlite3changeset_concat_strm( |
| 9968 | int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData), |
| 9969 | void *pInA, |
| 9970 | int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData), |
| 9971 | void *pInB, |
| 9972 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9973 | void *pOut |
| 9974 | ); |
| 9975 | int sqlite3changeset_invert_strm( |
| 9976 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9977 | void *pIn, |
| 9978 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9979 | void *pOut |
| 9980 | ); |
| 9981 | int sqlite3changeset_start_strm( |
| 9982 | sqlite3_changeset_iter **pp, |
| 9983 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9984 | void *pIn |
| 9985 | ); |
| 9986 | int sqlite3session_changeset_strm( |
| 9987 | sqlite3_session *pSession, |
| 9988 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9989 | void *pOut |
| 9990 | ); |
| 9991 | int sqlite3session_patchset_strm( |
| 9992 | sqlite3_session *pSession, |
| 9993 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9994 | void *pOut |
| 9995 | ); |
| 9996 | int sqlite3changegroup_add_strm(sqlite3_changegroup*, |
| 9997 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9998 | void *pIn |
| 9999 | ); |
| 10000 | int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 10001 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 10002 | void *pOut |
| 10003 | ); |
| 10004 | |
| 10005 | |
| 10006 | /* |
| @@ -10029,11 +10051,11 @@ | |
| 10051 | |
| 10052 | typedef struct Fts5ExtensionApi Fts5ExtensionApi; |
| 10053 | typedef struct Fts5Context Fts5Context; |
| 10054 | typedef struct Fts5PhraseIter Fts5PhraseIter; |
| 10055 | |
| 10056 | typedef void (SQLITE_CALLBACK *fts5_extension_function)( |
| 10057 | const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ |
| 10058 | Fts5Context *pFts, /* First arg to pass to pApi functions */ |
| 10059 | sqlite3_context *pCtx, /* Context for returning result/error */ |
| 10060 | int nVal, /* Number of values in apVal[] array */ |
| 10061 | sqlite3_value **apVal /* Array of trailing arguments */ |
| @@ -10080,15 +10102,15 @@ | |
| 10102 | ** This function may be quite inefficient if used with an FTS5 table |
| 10103 | ** created with the "columnsize=0" option. |
| 10104 | ** |
| 10105 | ** xColumnText: |
| 10106 | ** This function attempts to retrieve the text of column iCol of the |
| 10107 | ** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer |
| 10108 | ** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes |
| 10109 | ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, |
| 10110 | ** if an error occurs, an SQLite error code is returned and the final values |
| 10111 | ** of (SQLITE_CALLBACK *pz) and (*pn) are undefined. |
| 10112 | ** |
| 10113 | ** xPhraseCount: |
| 10114 | ** Returns the number of phrases in the current query expression. |
| 10115 | ** |
| 10116 | ** xPhraseSize: |
| @@ -10193,11 +10215,11 @@ | |
| 10215 | ** xRowCount(pFts5, pnRow) |
| 10216 | ** |
| 10217 | ** This function is used to retrieve the total number of rows in the table. |
| 10218 | ** In other words, the same value that would be returned by: |
| 10219 | ** |
| 10220 | ** SELECT count(SQLITE_CALLBACK *) FROM ftstable; |
| 10221 | ** |
| 10222 | ** xPhraseFirst() |
| 10223 | ** This function is used, along with type Fts5PhraseIter and the xPhraseNext |
| 10224 | ** method, to iterate through all instances of a single query phrase within |
| 10225 | ** the current row. This is the same information as is accessible via the |
| @@ -10260,43 +10282,43 @@ | |
| 10282 | ** See xPhraseFirstColumn above. |
| 10283 | */ |
| 10284 | struct Fts5ExtensionApi { |
| 10285 | int iVersion; /* Currently always set to 3 */ |
| 10286 | |
| 10287 | void *(SQLITE_CALLBACK *xUserData)(Fts5Context*); |
| 10288 | |
| 10289 | int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*); |
| 10290 | int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 10291 | int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); |
| 10292 | |
| 10293 | int (SQLITE_CALLBACK *xTokenize)(Fts5Context*, |
| 10294 | const char *pText, int nText, /* Text to tokenize */ |
| 10295 | void *pCtx, /* Context passed to xToken() */ |
| 10296 | int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */ |
| 10297 | ); |
| 10298 | |
| 10299 | int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*); |
| 10300 | int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase); |
| 10301 | |
| 10302 | int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst); |
| 10303 | int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); |
| 10304 | |
| 10305 | sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*); |
| 10306 | int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); |
| 10307 | int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken); |
| 10308 | |
| 10309 | int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, |
| 10310 | int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*) |
| 10311 | ); |
| 10312 | int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); |
| 10313 | void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear); |
| 10314 | |
| 10315 | int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); |
| 10316 | void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); |
| 10317 | |
| 10318 | int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); |
| 10319 | void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); |
| 10320 | }; |
| 10321 | |
| 10322 | /* |
| 10323 | ** CUSTOM AUXILIARY FUNCTIONS |
| 10324 | *************************************************************************/ |
| @@ -10320,11 +10342,11 @@ | |
| 10342 | ** The second and third arguments are an array of nul-terminated strings |
| 10343 | ** containing the tokenizer arguments, if any, specified following the |
| 10344 | ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used |
| 10345 | ** to create the FTS5 table. |
| 10346 | ** |
| 10347 | ** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut) |
| 10348 | ** should be set to point to the new tokenizer handle and SQLITE_OK |
| 10349 | ** returned. If an error occurs, some value other than SQLITE_OK should |
| 10350 | ** be returned. In this case, fts5 assumes that the final value of *ppOut |
| 10351 | ** is undefined. |
| 10352 | ** |
| @@ -10494,17 +10516,17 @@ | |
| 10516 | ** inefficient. |
| 10517 | */ |
| 10518 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| 10519 | typedef struct fts5_tokenizer fts5_tokenizer; |
| 10520 | struct fts5_tokenizer { |
| 10521 | int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); |
| 10522 | void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*); |
| 10523 | int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*, |
| 10524 | void *pCtx, |
| 10525 | int flags, /* Mask of FTS5_TOKENIZE_* flags */ |
| 10526 | const char *pText, int nText, |
| 10527 | int (SQLITE_CALLBACK *xToken)( |
| 10528 | void *pCtx, /* Copy of 2nd argument to xTokenize() */ |
| 10529 | int tflags, /* Mask of FTS5_TOKEN_* flags */ |
| 10530 | const char *pToken, /* Pointer to buffer containing token */ |
| 10531 | int nToken, /* Size of token in bytes */ |
| 10532 | int iStart, /* Byte offset of token within input text */ |
| @@ -10533,33 +10555,33 @@ | |
| 10555 | typedef struct fts5_api fts5_api; |
| 10556 | struct fts5_api { |
| 10557 | int iVersion; /* Currently always set to 2 */ |
| 10558 | |
| 10559 | /* Create a new tokenizer */ |
| 10560 | int (SQLITE_CALLBACK *xCreateTokenizer)( |
| 10561 | fts5_api *pApi, |
| 10562 | const char *zName, |
| 10563 | void *pContext, |
| 10564 | fts5_tokenizer *pTokenizer, |
| 10565 | void (SQLITE_CALLBACK *xDestroy)(void*) |
| 10566 | ); |
| 10567 | |
| 10568 | /* Find an existing tokenizer */ |
| 10569 | int (SQLITE_CALLBACK *xFindTokenizer)( |
| 10570 | fts5_api *pApi, |
| 10571 | const char *zName, |
| 10572 | void **ppContext, |
| 10573 | fts5_tokenizer *pTokenizer |
| 10574 | ); |
| 10575 | |
| 10576 | /* Create a new auxiliary function */ |
| 10577 | int (SQLITE_CALLBACK *xCreateFunction)( |
| 10578 | fts5_api *pApi, |
| 10579 | const char *zName, |
| 10580 | void *pContext, |
| 10581 | fts5_extension_function xFunction, |
| 10582 | void (SQLITE_CALLBACK *xDestroy)(void*) |
| 10583 | ); |
| 10584 | }; |
| 10585 | |
| 10586 | /* |
| 10587 | ** END OF REGISTRATION API |
| @@ -11873,12 +11895,12 @@ | |
| 11895 | */ |
| 11896 | #ifdef SQLITE_OMIT_WSD |
| 11897 | #define SQLITE_WSD const |
| 11898 | #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v))) |
| 11899 | #define sqlite3GlobalConfig GLOBAL(struct Sqlite3Config, sqlite3Config) |
| 11900 | SQLITE_API int SQLITE_APICALL sqlite3_wsd_init(int N, int J); |
| 11901 | SQLITE_API void *SQLITE_APICALL sqlite3_wsd_find(void *K, int L); |
| 11902 | #else |
| 11903 | #define SQLITE_WSD |
| 11904 | #define GLOBAL(t,v) v |
| 11905 | #define sqlite3GlobalConfig sqlite3Config |
| 11906 | #endif |
| @@ -17165,12 +17187,14 @@ | |
| 17187 | "CASE_SENSITIVE_LIKE", |
| 17188 | #endif |
| 17189 | #if SQLITE_CHECK_PAGES |
| 17190 | "CHECK_PAGES", |
| 17191 | #endif |
| 17192 | #if defined(__clang__) && defined(__clang_major__) |
| 17193 | "COMPILER=clang-" CTIMEOPT_VAL(__clang_major__) "." |
| 17194 | CTIMEOPT_VAL(__clang_minor__) "." |
| 17195 | CTIMEOPT_VAL(__clang_patchlevel__), |
| 17196 | #elif defined(_MSC_VER) |
| 17197 | "COMPILER=msvc-" CTIMEOPT_VAL(_MSC_VER), |
| 17198 | #elif defined(__GNUC__) && defined(__VERSION__) |
| 17199 | "COMPILER=gcc-" __VERSION__, |
| 17200 | #endif |
| @@ -17531,11 +17555,11 @@ | |
| 17555 | ** was used and false if not. |
| 17556 | ** |
| 17557 | ** The name can optionally begin with "SQLITE_" but the "SQLITE_" prefix |
| 17558 | ** is not required for a match. |
| 17559 | */ |
| 17560 | SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName){ |
| 17561 | int i, n; |
| 17562 | |
| 17563 | #if SQLITE_ENABLE_API_ARMOR |
| 17564 | if( zOptName==0 ){ |
| 17565 | (void)SQLITE_MISUSE_BKPT; |
| @@ -17559,11 +17583,11 @@ | |
| 17583 | |
| 17584 | /* |
| 17585 | ** Return the N-th compile-time option string. If N is out of range, |
| 17586 | ** return a NULL pointer. |
| 17587 | */ |
| 17588 | SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N){ |
| 17589 | if( N>=0 && N<ArraySize(azCompileOpt) ){ |
| 17590 | return azCompileOpt[N]; |
| 17591 | } |
| 17592 | return 0; |
| 17593 | } |
| @@ -18269,11 +18293,11 @@ | |
| 18293 | } |
| 18294 | |
| 18295 | /* |
| 18296 | ** Query status information. |
| 18297 | */ |
| 18298 | SQLITE_API int SQLITE_APICALL sqlite3_status64( |
| 18299 | int op, |
| 18300 | sqlite3_int64 *pCurrent, |
| 18301 | sqlite3_int64 *pHighwater, |
| 18302 | int resetFlag |
| 18303 | ){ |
| @@ -18294,11 +18318,11 @@ | |
| 18318 | } |
| 18319 | sqlite3_mutex_leave(pMutex); |
| 18320 | (void)pMutex; /* Prevent warning when SQLITE_THREADSAFE=0 */ |
| 18321 | return SQLITE_OK; |
| 18322 | } |
| 18323 | SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag){ |
| 18324 | sqlite3_int64 iCur, iHwtr; |
| 18325 | int rc; |
| 18326 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 18327 | if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT; |
| 18328 | #endif |
| @@ -18311,11 +18335,11 @@ | |
| 18335 | } |
| 18336 | |
| 18337 | /* |
| 18338 | ** Query status information for a single database connection |
| 18339 | */ |
| 18340 | SQLITE_API int SQLITE_APICALL sqlite3_db_status( |
| 18341 | sqlite3 *db, /* The database connection whose status is desired */ |
| 18342 | int op, /* Status verb */ |
| 18343 | int *pCurrent, /* Write current value here */ |
| 18344 | int *pHighwater, /* Write high-water mark here */ |
| 18345 | int resetFlag /* Reset high-water mark if true */ |
| @@ -19989,11 +20013,11 @@ | |
| 20013 | |
| 20014 | /* |
| 20015 | ** Locate a VFS by name. If no name is given, simply return the |
| 20016 | ** first VFS on the list. |
| 20017 | */ |
| 20018 | SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfs){ |
| 20019 | sqlite3_vfs *pVfs = 0; |
| 20020 | #if SQLITE_THREADSAFE |
| 20021 | sqlite3_mutex *mutex; |
| 20022 | #endif |
| 20023 | #ifndef SQLITE_OMIT_AUTOINIT |
| @@ -20035,11 +20059,11 @@ | |
| 20059 | /* |
| 20060 | ** Register a VFS with the system. It is harmless to register the same |
| 20061 | ** VFS multiple times. The new VFS becomes the default if makeDflt is |
| 20062 | ** true. |
| 20063 | */ |
| 20064 | SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs *pVfs, int makeDflt){ |
| 20065 | MUTEX_LOGIC(sqlite3_mutex *mutex;) |
| 20066 | #ifndef SQLITE_OMIT_AUTOINIT |
| 20067 | int rc = sqlite3_initialize(); |
| 20068 | if( rc ) return rc; |
| 20069 | #endif |
| @@ -20063,11 +20087,11 @@ | |
| 20087 | } |
| 20088 | |
| 20089 | /* |
| 20090 | ** Unregister a VFS so that it is no longer accessible. |
| 20091 | */ |
| 20092 | SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs *pVfs){ |
| 20093 | #if SQLITE_THREADSAFE |
| 20094 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 20095 | #endif |
| 20096 | sqlite3_mutex_enter(mutex); |
| 20097 | vfsUnlink(pVfs); |
| @@ -22414,11 +22438,11 @@ | |
| 22438 | } |
| 22439 | |
| 22440 | /* |
| 22441 | ** Retrieve a pointer to a static mutex or allocate a new dynamic one. |
| 22442 | */ |
| 22443 | SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int id){ |
| 22444 | #ifndef SQLITE_OMIT_AUTOINIT |
| 22445 | if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0; |
| 22446 | if( id>SQLITE_MUTEX_RECURSIVE && sqlite3MutexInit() ) return 0; |
| 22447 | #endif |
| 22448 | assert( sqlite3GlobalConfig.mutex.xMutexAlloc ); |
| @@ -22435,11 +22459,11 @@ | |
| 22459 | } |
| 22460 | |
| 22461 | /* |
| 22462 | ** Free a dynamic mutex. |
| 22463 | */ |
| 22464 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex *p){ |
| 22465 | if( p ){ |
| 22466 | assert( sqlite3GlobalConfig.mutex.xMutexFree ); |
| 22467 | sqlite3GlobalConfig.mutex.xMutexFree(p); |
| 22468 | } |
| 22469 | } |
| @@ -22446,11 +22470,11 @@ | |
| 22470 | |
| 22471 | /* |
| 22472 | ** Obtain the mutex p. If some other thread already has the mutex, block |
| 22473 | ** until it can be obtained. |
| 22474 | */ |
| 22475 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex *p){ |
| 22476 | if( p ){ |
| 22477 | assert( sqlite3GlobalConfig.mutex.xMutexEnter ); |
| 22478 | sqlite3GlobalConfig.mutex.xMutexEnter(p); |
| 22479 | } |
| 22480 | } |
| @@ -22457,11 +22481,11 @@ | |
| 22481 | |
| 22482 | /* |
| 22483 | ** Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another |
| 22484 | ** thread holds the mutex and it cannot be obtained, return SQLITE_BUSY. |
| 22485 | */ |
| 22486 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex *p){ |
| 22487 | int rc = SQLITE_OK; |
| 22488 | if( p ){ |
| 22489 | assert( sqlite3GlobalConfig.mutex.xMutexTry ); |
| 22490 | return sqlite3GlobalConfig.mutex.xMutexTry(p); |
| 22491 | } |
| @@ -22472,11 +22496,11 @@ | |
| 22496 | ** The sqlite3_mutex_leave() routine exits a mutex that was previously |
| 22497 | ** entered by the same thread. The behavior is undefined if the mutex |
| 22498 | ** is not currently entered. If a NULL pointer is passed as an argument |
| 22499 | ** this function is a no-op. |
| 22500 | */ |
| 22501 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex *p){ |
| 22502 | if( p ){ |
| 22503 | assert( sqlite3GlobalConfig.mutex.xMutexLeave ); |
| 22504 | sqlite3GlobalConfig.mutex.xMutexLeave(p); |
| 22505 | } |
| 22506 | } |
| @@ -22484,15 +22508,15 @@ | |
| 22508 | #ifndef NDEBUG |
| 22509 | /* |
| 22510 | ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are |
| 22511 | ** intended for use inside assert() statements. |
| 22512 | */ |
| 22513 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex *p){ |
| 22514 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexHeld ); |
| 22515 | return p==0 || sqlite3GlobalConfig.mutex.xMutexHeld(p); |
| 22516 | } |
| 22517 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex *p){ |
| 22518 | assert( p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld ); |
| 22519 | return p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld(p); |
| 22520 | } |
| 22521 | #endif |
| 22522 | |
| @@ -23520,12 +23544,12 @@ | |
| 23544 | ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the |
| 23545 | ** "interlocked" magic used here is probably not strictly necessary. |
| 23546 | */ |
| 23547 | static LONG SQLITE_WIN32_VOLATILE winMutex_lock = 0; |
| 23548 | |
| 23549 | SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void); /* os_win.c */ |
| 23550 | SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */ |
| 23551 | |
| 23552 | static int winMutexInit(void){ |
| 23553 | /* The first to increment to 1 does actual initialization */ |
| 23554 | if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){ |
| 23555 | int i; |
| @@ -23821,11 +23845,11 @@ | |
| 23845 | /* |
| 23846 | ** Attempt to release up to n bytes of non-essential memory currently |
| 23847 | ** held by SQLite. An example of non-essential memory is memory used to |
| 23848 | ** cache database pages that are not currently in use. |
| 23849 | */ |
| 23850 | SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int n){ |
| 23851 | #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT |
| 23852 | return sqlite3PcacheReleaseMemory(n); |
| 23853 | #else |
| 23854 | /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine |
| 23855 | ** is a no-op returning zero if SQLite is not compiled with |
| @@ -23880,11 +23904,11 @@ | |
| 23904 | /* |
| 23905 | ** Deprecated external interface. It used to set an alarm callback |
| 23906 | ** that was invoked when memory usage grew too large. Now it is a |
| 23907 | ** no-op. |
| 23908 | */ |
| 23909 | SQLITE_API int SQLITE_APICALL sqlite3_memory_alarm( |
| 23910 | void(*xCallback)(void *pArg, sqlite3_int64 used,int N), |
| 23911 | void *pArg, |
| 23912 | sqlite3_int64 iThreshold |
| 23913 | ){ |
| 23914 | (void)xCallback; |
| @@ -23896,11 +23920,11 @@ | |
| 23920 | |
| 23921 | /* |
| 23922 | ** Set the soft heap-size limit for the library. Passing a zero or |
| 23923 | ** negative value indicates no limit. |
| 23924 | */ |
| 23925 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 n){ |
| 23926 | sqlite3_int64 priorLimit; |
| 23927 | sqlite3_int64 excess; |
| 23928 | sqlite3_int64 nUsed; |
| 23929 | #ifndef SQLITE_OMIT_AUTOINIT |
| 23930 | int rc = sqlite3_initialize(); |
| @@ -23918,11 +23942,11 @@ | |
| 23942 | sqlite3_mutex_leave(mem0.mutex); |
| 23943 | excess = sqlite3_memory_used() - n; |
| 23944 | if( excess>0 ) sqlite3_release_memory((int)(excess & 0x7fffffff)); |
| 23945 | return priorLimit; |
| 23946 | } |
| 23947 | SQLITE_API void SQLITE_APICALL sqlite3_soft_heap_limit(int n){ |
| 23948 | if( n<0 ) n = 0; |
| 23949 | sqlite3_soft_heap_limit64(n); |
| 23950 | } |
| 23951 | |
| 23952 | /* |
| @@ -23987,11 +24011,11 @@ | |
| 24011 | } |
| 24012 | |
| 24013 | /* |
| 24014 | ** Return the amount of memory currently checked out. |
| 24015 | */ |
| 24016 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void){ |
| 24017 | sqlite3_int64 res, mx; |
| 24018 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, 0); |
| 24019 | return res; |
| 24020 | } |
| 24021 | |
| @@ -23998,11 +24022,11 @@ | |
| 24022 | /* |
| 24023 | ** Return the maximum amount of memory that has ever been |
| 24024 | ** checked out since either the beginning of this process |
| 24025 | ** or since the most recent reset. |
| 24026 | */ |
| 24027 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag){ |
| 24028 | sqlite3_int64 res, mx; |
| 24029 | sqlite3_status64(SQLITE_STATUS_MEMORY_USED, &res, &mx, resetFlag); |
| 24030 | return mx; |
| 24031 | } |
| 24032 | |
| @@ -24078,17 +24102,17 @@ | |
| 24102 | /* |
| 24103 | ** This version of the memory allocation is for use by the application. |
| 24104 | ** First make sure the memory subsystem is initialized, then do the |
| 24105 | ** allocation. |
| 24106 | */ |
| 24107 | SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int n){ |
| 24108 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24109 | if( sqlite3_initialize() ) return 0; |
| 24110 | #endif |
| 24111 | return n<=0 ? 0 : sqlite3Malloc(n); |
| 24112 | } |
| 24113 | SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64 n){ |
| 24114 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24115 | if( sqlite3_initialize() ) return 0; |
| 24116 | #endif |
| 24117 | return sqlite3Malloc(n); |
| 24118 | } |
| @@ -24227,20 +24251,20 @@ | |
| 24251 | }else{ |
| 24252 | assert( sqlite3_mutex_held(db->mutex) ); |
| 24253 | return db->lookaside.sz; |
| 24254 | } |
| 24255 | } |
| 24256 | SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void *p){ |
| 24257 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24258 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24259 | return p ? sqlite3GlobalConfig.m.xSize(p) : 0; |
| 24260 | } |
| 24261 | |
| 24262 | /* |
| 24263 | ** Free memory previously obtained from sqlite3Malloc(). |
| 24264 | */ |
| 24265 | SQLITE_API void SQLITE_APICALL sqlite3_free(void *p){ |
| 24266 | if( p==0 ) return; /* IMP: R-49053-54554 */ |
| 24267 | assert( sqlite3MemdebugHasType(p, MEMTYPE_HEAP) ); |
| 24268 | assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) ); |
| 24269 | if( sqlite3GlobalConfig.bMemstat ){ |
| 24270 | sqlite3_mutex_enter(mem0.mutex); |
| @@ -24345,18 +24369,18 @@ | |
| 24369 | |
| 24370 | /* |
| 24371 | ** The public interface to sqlite3Realloc. Make sure that the memory |
| 24372 | ** subsystem is initialized prior to invoking sqliteRealloc. |
| 24373 | */ |
| 24374 | SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void *pOld, int n){ |
| 24375 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24376 | if( sqlite3_initialize() ) return 0; |
| 24377 | #endif |
| 24378 | if( n<0 ) n = 0; /* IMP: R-26507-47431 */ |
| 24379 | return sqlite3Realloc(pOld, n); |
| 24380 | } |
| 24381 | SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void *pOld, sqlite3_uint64 n){ |
| 24382 | #ifndef SQLITE_OMIT_AUTOINIT |
| 24383 | if( sqlite3_initialize() ) return 0; |
| 24384 | #endif |
| 24385 | return sqlite3Realloc(pOld, n); |
| 24386 | } |
| @@ -25579,11 +25603,11 @@ | |
| 25603 | |
| 25604 | /* |
| 25605 | ** Print into memory obtained from sqlite3_malloc(). Omit the internal |
| 25606 | ** %-conversion extensions. |
| 25607 | */ |
| 25608 | SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char *zFormat, va_list ap){ |
| 25609 | char *z; |
| 25610 | char zBase[SQLITE_PRINT_BUF_SIZE]; |
| 25611 | StrAccum acc; |
| 25612 | |
| 25613 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -25628,11 +25652,11 @@ | |
| 25652 | ** this without breaking compatibility, so we just have to live with the |
| 25653 | ** mistake. |
| 25654 | ** |
| 25655 | ** sqlite3_vsnprintf() is the varargs version. |
| 25656 | */ |
| 25657 | SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int n, char *zBuf, const char *zFormat, va_list ap){ |
| 25658 | StrAccum acc; |
| 25659 | if( n<=0 ) return zBuf; |
| 25660 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 25661 | if( zBuf==0 || zFormat==0 ) { |
| 25662 | (void)SQLITE_MISUSE_BKPT; |
| @@ -26255,11 +26279,11 @@ | |
| 26279 | } sqlite3Prng; |
| 26280 | |
| 26281 | /* |
| 26282 | ** Return N random bytes. |
| 26283 | */ |
| 26284 | SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *pBuf){ |
| 26285 | unsigned char t; |
| 26286 | unsigned char *zBuf = pBuf; |
| 26287 | |
| 26288 | /* The "wsdPrng" macro will resolve to the pseudo-random number generator |
| 26289 | ** state vector. If writable static data is unsupported on the target, |
| @@ -27458,11 +27482,11 @@ | |
| 27482 | ** sqlite3_strnicmp() APIs allow applications and extensions to compare |
| 27483 | ** the contents of two buffers containing UTF-8 strings in a |
| 27484 | ** case-independent fashion, using the same definition of "case |
| 27485 | ** independence" that SQLite uses internally when comparing identifiers. |
| 27486 | */ |
| 27487 | SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *zLeft, const char *zRight){ |
| 27488 | if( zLeft==0 ){ |
| 27489 | return zRight ? -1 : 0; |
| 27490 | }else if( zRight==0 ){ |
| 27491 | return 1; |
| 27492 | } |
| @@ -27479,11 +27503,11 @@ | |
| 27503 | a++; |
| 27504 | b++; |
| 27505 | } |
| 27506 | return c; |
| 27507 | } |
| 27508 | SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){ |
| 27509 | register unsigned char *a, *b; |
| 27510 | if( zLeft==0 ){ |
| 27511 | return zRight ? -1 : 0; |
| 27512 | }else if( zRight==0 ){ |
| 27513 | return 1; |
| @@ -36778,11 +36802,11 @@ | |
| 36802 | ** This routine is called once during SQLite initialization and by a |
| 36803 | ** single thread. The memory allocation and mutex subsystems have not |
| 36804 | ** necessarily been initialized when this routine is called, and so they |
| 36805 | ** should not be used. |
| 36806 | */ |
| 36807 | SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){ |
| 36808 | /* |
| 36809 | ** The following macro defines an initializer for an sqlite3_vfs object. |
| 36810 | ** The name of the VFS is NAME. The pAppData is a pointer to a pointer |
| 36811 | ** to the "finder" function. (pAppData is a pointer to a pointer because |
| 36812 | ** silly C90 rules prohibit a void* from being cast to a function pointer |
| @@ -36877,11 +36901,11 @@ | |
| 36901 | ** |
| 36902 | ** Some operating systems might need to do some cleanup in this routine, |
| 36903 | ** to release dynamically allocated objects. But not on unix. |
| 36904 | ** This routine is a no-op for unix. |
| 36905 | */ |
| 36906 | SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){ |
| 36907 | return SQLITE_OK; |
| 36908 | } |
| 36909 | |
| 36910 | #endif /* SQLITE_OS_UNIX */ |
| 36911 | |
| @@ -38312,11 +38336,11 @@ | |
| 38336 | ** compact it. Upon success, SQLITE_OK will be returned. Upon failure, one |
| 38337 | ** of SQLITE_NOMEM, SQLITE_ERROR, or SQLITE_NOTFOUND will be returned. The |
| 38338 | ** "pnLargest" argument, if non-zero, will be used to return the size of the |
| 38339 | ** largest committed free block in the heap, in bytes. |
| 38340 | */ |
| 38341 | SQLITE_API int SQLITE_APICALL sqlite3_win32_compact_heap(LPUINT pnLargest){ |
| 38342 | int rc = SQLITE_OK; |
| 38343 | UINT nLargest = 0; |
| 38344 | HANDLE hHeap; |
| 38345 | |
| 38346 | winMemAssertMagic(); |
| @@ -38352,11 +38376,11 @@ | |
| 38376 | ** If a Win32 native heap has been configured, this function will attempt to |
| 38377 | ** destroy and recreate it. If the Win32 native heap is not isolated and/or |
| 38378 | ** the sqlite3_memory_used() function does not return zero, SQLITE_BUSY will |
| 38379 | ** be returned and no changes will be made to the Win32 native heap. |
| 38380 | */ |
| 38381 | SQLITE_API int SQLITE_APICALL sqlite3_win32_reset_heap(){ |
| 38382 | int rc; |
| 38383 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 38384 | MUTEX_LOGIC( sqlite3_mutex *pMem; ) /* The memsys static mutex */ |
| 38385 | MUTEX_LOGIC( pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); ) |
| 38386 | MUTEX_LOGIC( pMem = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); ) |
| @@ -38397,11 +38421,11 @@ | |
| 38421 | /* |
| 38422 | ** This function outputs the specified (ANSI) string to the Win32 debugger |
| 38423 | ** (if available). |
| 38424 | */ |
| 38425 | |
| 38426 | SQLITE_API void SQLITE_APICALL sqlite3_win32_write_debug(const char *zBuf, int nBuf){ |
| 38427 | char zDbgBuf[SQLITE_WIN32_DBG_BUF_SIZE]; |
| 38428 | int nMin = MIN(nBuf, (SQLITE_WIN32_DBG_BUF_SIZE - 1)); /* may be negative. */ |
| 38429 | if( nMin<-1 ) nMin = -1; /* all negative values become -1. */ |
| 38430 | assert( nMin==-1 || nMin==0 || nMin<SQLITE_WIN32_DBG_BUF_SIZE ); |
| 38431 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -38443,11 +38467,11 @@ | |
| 38467 | */ |
| 38468 | #if SQLITE_OS_WINRT |
| 38469 | static HANDLE sleepObj = NULL; |
| 38470 | #endif |
| 38471 | |
| 38472 | SQLITE_API void SQLITE_APICALL sqlite3_win32_sleep(DWORD milliseconds){ |
| 38473 | #if SQLITE_OS_WINRT |
| 38474 | if ( sleepObj==NULL ){ |
| 38475 | sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET, |
| 38476 | SYNCHRONIZE); |
| 38477 | } |
| @@ -38492,11 +38516,11 @@ | |
| 38516 | |
| 38517 | /* |
| 38518 | ** This function determines if the machine is running a version of Windows |
| 38519 | ** based on the NT kernel. |
| 38520 | */ |
| 38521 | SQLITE_API int SQLITE_APICALL sqlite3_win32_is_nt(void){ |
| 38522 | #if SQLITE_OS_WINRT |
| 38523 | /* |
| 38524 | ** NOTE: The WinRT sub-platform is always assumed to be based on the NT |
| 38525 | ** kernel. |
| 38526 | */ |
| @@ -38880,11 +38904,11 @@ | |
| 38904 | } |
| 38905 | |
| 38906 | /* |
| 38907 | ** This is a public wrapper for the winUtf8ToUnicode() function. |
| 38908 | */ |
| 38909 | SQLITE_API LPWSTR SQLITE_APICALL sqlite3_win32_utf8_to_unicode(const char *zText){ |
| 38910 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38911 | if( !zText ){ |
| 38912 | (void)SQLITE_MISUSE_BKPT; |
| 38913 | return 0; |
| 38914 | } |
| @@ -38896,11 +38920,11 @@ | |
| 38920 | } |
| 38921 | |
| 38922 | /* |
| 38923 | ** This is a public wrapper for the winUnicodeToUtf8() function. |
| 38924 | */ |
| 38925 | SQLITE_API char *SQLITE_APICALL sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ |
| 38926 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38927 | if( !zWideText ){ |
| 38928 | (void)SQLITE_MISUSE_BKPT; |
| 38929 | return 0; |
| 38930 | } |
| @@ -38912,11 +38936,11 @@ | |
| 38936 | } |
| 38937 | |
| 38938 | /* |
| 38939 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 38940 | */ |
| 38941 | SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8(const char *zText){ |
| 38942 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38943 | if( !zText ){ |
| 38944 | (void)SQLITE_MISUSE_BKPT; |
| 38945 | return 0; |
| 38946 | } |
| @@ -38928,11 +38952,11 @@ | |
| 38952 | } |
| 38953 | |
| 38954 | /* |
| 38955 | ** This is a public wrapper for the winMbcsToUtf8() function. |
| 38956 | */ |
| 38957 | SQLITE_API char *SQLITE_APICALL sqlite3_win32_mbcs_to_utf8_v2(const char *zText, int useAnsi){ |
| 38958 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38959 | if( !zText ){ |
| 38960 | (void)SQLITE_MISUSE_BKPT; |
| 38961 | return 0; |
| 38962 | } |
| @@ -38944,11 +38968,11 @@ | |
| 38968 | } |
| 38969 | |
| 38970 | /* |
| 38971 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 38972 | */ |
| 38973 | SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs(const char *zText){ |
| 38974 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38975 | if( !zText ){ |
| 38976 | (void)SQLITE_MISUSE_BKPT; |
| 38977 | return 0; |
| 38978 | } |
| @@ -38960,11 +38984,11 @@ | |
| 38984 | } |
| 38985 | |
| 38986 | /* |
| 38987 | ** This is a public wrapper for the winUtf8ToMbcs() function. |
| 38988 | */ |
| 38989 | SQLITE_API char *SQLITE_APICALL sqlite3_win32_utf8_to_mbcs_v2(const char *zText, int useAnsi){ |
| 38990 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 38991 | if( !zText ){ |
| 38992 | (void)SQLITE_MISUSE_BKPT; |
| 38993 | return 0; |
| 38994 | } |
| @@ -38980,11 +39004,11 @@ | |
| 39004 | ** the provided arguments. The type argument must be 1 in order to set the |
| 39005 | ** data directory or 2 in order to set the temporary directory. The zValue |
| 39006 | ** argument is the name of the directory to use. The return value will be |
| 39007 | ** SQLITE_OK if successful. |
| 39008 | */ |
| 39009 | SQLITE_API int SQLITE_APICALL sqlite3_win32_set_directory(DWORD type, LPCWSTR zValue){ |
| 39010 | char **ppDirectory = 0; |
| 39011 | #ifndef SQLITE_OMIT_AUTOINIT |
| 39012 | int rc = sqlite3_initialize(); |
| 39013 | if( rc ) return rc; |
| 39014 | #endif |
| @@ -42898,11 +42922,11 @@ | |
| 42922 | } |
| 42923 | |
| 42924 | /* |
| 42925 | ** Initialize and deinitialize the operating system interface. |
| 42926 | */ |
| 42927 | SQLITE_API int SQLITE_APICALL sqlite3_os_init(void){ |
| 42928 | static sqlite3_vfs winVfs = { |
| 42929 | 3, /* iVersion */ |
| 42930 | sizeof(winFile), /* szOsFile */ |
| 42931 | SQLITE_WIN32_MAX_PATH_BYTES, /* mxPathname */ |
| 42932 | 0, /* pNext */ |
| @@ -43029,11 +43053,11 @@ | |
| 43053 | #endif |
| 43054 | |
| 43055 | return SQLITE_OK; |
| 43056 | } |
| 43057 | |
| 43058 | SQLITE_API int SQLITE_APICALL sqlite3_os_end(void){ |
| 43059 | #if SQLITE_OS_WINRT |
| 43060 | if( sleepObj!=NULL ){ |
| 43061 | osCloseHandle(sleepObj); |
| 43062 | sleepObj = NULL; |
| 43063 | } |
| @@ -57024,11 +57048,11 @@ | |
| 57048 | |
| 57049 | /* |
| 57050 | ** Return a +ve value if snapshot p1 is newer than p2. A -ve value if |
| 57051 | ** p1 is older than p2 and zero if p1 and p2 are the same snapshot. |
| 57052 | */ |
| 57053 | SQLITE_API int SQLITE_APICALL sqlite3_snapshot_cmp(sqlite3_snapshot *p1, sqlite3_snapshot *p2){ |
| 57054 | WalIndexHdr *pHdr1 = (WalIndexHdr*)p1; |
| 57055 | WalIndexHdr *pHdr2 = (WalIndexHdr*)p2; |
| 57056 | |
| 57057 | /* aSalt[0] is a copy of the value stored in the wal file header. It |
| 57058 | ** is incremented each time the wal file is restarted. */ |
| @@ -58161,11 +58185,11 @@ | |
| 58185 | ** |
| 58186 | ** This routine has no effect on existing database connections. |
| 58187 | ** The shared cache setting effects only future calls to |
| 58188 | ** sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2(). |
| 58189 | */ |
| 58190 | SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int enable){ |
| 58191 | sqlite3GlobalConfig.sharedCacheEnabled = enable; |
| 58192 | return SQLITE_OK; |
| 58193 | } |
| 58194 | #endif |
| 58195 | |
| @@ -67934,11 +67958,11 @@ | |
| 67958 | ** a pointer to the new sqlite3_backup object. |
| 67959 | ** |
| 67960 | ** If an error occurs, NULL is returned and an error code and error message |
| 67961 | ** stored in database handle pDestDb. |
| 67962 | */ |
| 67963 | SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init( |
| 67964 | sqlite3* pDestDb, /* Database to write to */ |
| 67965 | const char *zDestDb, /* Name of database within pDestDb */ |
| 67966 | sqlite3* pSrcDb, /* Database connection to read from */ |
| 67967 | const char *zSrcDb /* Name of database within pSrcDb */ |
| 67968 | ){ |
| @@ -68142,11 +68166,11 @@ | |
| 68166 | } |
| 68167 | |
| 68168 | /* |
| 68169 | ** Copy nPage pages from the source b-tree to the destination. |
| 68170 | */ |
| 68171 | SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage){ |
| 68172 | int rc; |
| 68173 | int destMode; /* Destination journal mode */ |
| 68174 | int pgszSrc = 0; /* Source page size */ |
| 68175 | int pgszDest = 0; /* Destination page size */ |
| 68176 | |
| @@ -68386,11 +68410,11 @@ | |
| 68410 | } |
| 68411 | |
| 68412 | /* |
| 68413 | ** Release all resources associated with an sqlite3_backup* handle. |
| 68414 | */ |
| 68415 | SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p){ |
| 68416 | sqlite3_backup **pp; /* Ptr to head of pagers backup list */ |
| 68417 | sqlite3 *pSrcDb; /* Source database connection */ |
| 68418 | int rc; /* Value to return */ |
| 68419 | |
| 68420 | /* Enter the mutexes */ |
| @@ -68438,11 +68462,11 @@ | |
| 68462 | |
| 68463 | /* |
| 68464 | ** Return the number of pages still to be backed up as of the most recent |
| 68465 | ** call to sqlite3_backup_step(). |
| 68466 | */ |
| 68467 | SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p){ |
| 68468 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68469 | if( p==0 ){ |
| 68470 | (void)SQLITE_MISUSE_BKPT; |
| 68471 | return 0; |
| 68472 | } |
| @@ -68452,11 +68476,11 @@ | |
| 68476 | |
| 68477 | /* |
| 68478 | ** Return the total number of pages in the source database as of the most |
| 68479 | ** recent call to sqlite3_backup_step(). |
| 68480 | */ |
| 68481 | SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p){ |
| 68482 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 68483 | if( p==0 ){ |
| 68484 | (void)SQLITE_MISUSE_BKPT; |
| 68485 | return 0; |
| 68486 | } |
| @@ -74906,11 +74930,11 @@ | |
| 74930 | ** execution environment changes in a way that would alter the program |
| 74931 | ** that sqlite3_prepare() generates. For example, if new functions or |
| 74932 | ** collating sequences are registered or if an authorizer function is |
| 74933 | ** added or changed. |
| 74934 | */ |
| 74935 | SQLITE_API int SQLITE_APICALL sqlite3_expired(sqlite3_stmt *pStmt){ |
| 74936 | Vdbe *p = (Vdbe*)pStmt; |
| 74937 | return p==0 || p->expired; |
| 74938 | } |
| 74939 | #endif |
| 74940 | |
| @@ -74975,11 +74999,11 @@ | |
| 74999 | ** machine. |
| 75000 | ** |
| 75001 | ** This routine sets the error code and string returned by |
| 75002 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 75003 | */ |
| 75004 | SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt){ |
| 75005 | int rc; |
| 75006 | if( pStmt==0 ){ |
| 75007 | /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL |
| 75008 | ** pointer is a harmless no-op. */ |
| 75009 | rc = SQLITE_OK; |
| @@ -75002,11 +75026,11 @@ | |
| 75026 | ** the prior execution is returned. |
| 75027 | ** |
| 75028 | ** This routine sets the error code and string returned by |
| 75029 | ** sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16(). |
| 75030 | */ |
| 75031 | SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt){ |
| 75032 | int rc; |
| 75033 | if( pStmt==0 ){ |
| 75034 | rc = SQLITE_OK; |
| 75035 | }else{ |
| 75036 | Vdbe *v = (Vdbe*)pStmt; |
| @@ -75023,11 +75047,11 @@ | |
| 75047 | } |
| 75048 | |
| 75049 | /* |
| 75050 | ** Set all the parameters in the compiled SQL statement to NULL. |
| 75051 | */ |
| 75052 | SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt *pStmt){ |
| 75053 | int i; |
| 75054 | int rc = SQLITE_OK; |
| 75055 | Vdbe *p = (Vdbe*)pStmt; |
| 75056 | #if SQLITE_THREADSAFE |
| 75057 | sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex; |
| @@ -75047,11 +75071,11 @@ | |
| 75071 | |
| 75072 | /**************************** sqlite3_value_ ******************************* |
| 75073 | ** The following routines extract information from a Mem or sqlite3_value |
| 75074 | ** structure. |
| 75075 | */ |
| 75076 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value *pVal){ |
| 75077 | Mem *p = (Mem*)pVal; |
| 75078 | if( p->flags & (MEM_Blob|MEM_Str) ){ |
| 75079 | if( sqlite3VdbeMemExpandBlob(p)!=SQLITE_OK ){ |
| 75080 | assert( p->flags==MEM_Null && p->z==0 ); |
| 75081 | return 0; |
| @@ -75060,48 +75084,48 @@ | |
| 75084 | return p->n ? p->z : 0; |
| 75085 | }else{ |
| 75086 | return sqlite3_value_text(pVal); |
| 75087 | } |
| 75088 | } |
| 75089 | SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value *pVal){ |
| 75090 | return sqlite3ValueBytes(pVal, SQLITE_UTF8); |
| 75091 | } |
| 75092 | SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value *pVal){ |
| 75093 | return sqlite3ValueBytes(pVal, SQLITE_UTF16NATIVE); |
| 75094 | } |
| 75095 | SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value *pVal){ |
| 75096 | return sqlite3VdbeRealValue((Mem*)pVal); |
| 75097 | } |
| 75098 | SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value *pVal){ |
| 75099 | return (int)sqlite3VdbeIntValue((Mem*)pVal); |
| 75100 | } |
| 75101 | SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value *pVal){ |
| 75102 | return sqlite3VdbeIntValue((Mem*)pVal); |
| 75103 | } |
| 75104 | SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value *pVal){ |
| 75105 | Mem *pMem = (Mem*)pVal; |
| 75106 | return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0); |
| 75107 | } |
| 75108 | SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value *pVal){ |
| 75109 | return (const unsigned char *)sqlite3ValueText(pVal, SQLITE_UTF8); |
| 75110 | } |
| 75111 | #ifndef SQLITE_OMIT_UTF16 |
| 75112 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value* pVal){ |
| 75113 | return sqlite3ValueText(pVal, SQLITE_UTF16NATIVE); |
| 75114 | } |
| 75115 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value *pVal){ |
| 75116 | return sqlite3ValueText(pVal, SQLITE_UTF16BE); |
| 75117 | } |
| 75118 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value *pVal){ |
| 75119 | return sqlite3ValueText(pVal, SQLITE_UTF16LE); |
| 75120 | } |
| 75121 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75122 | /* EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five |
| 75123 | ** fundamental datatypes: 64-bit signed integer 64-bit IEEE floating |
| 75124 | ** point number string BLOB NULL |
| 75125 | */ |
| 75126 | SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value* pVal){ |
| 75127 | static const u8 aType[] = { |
| 75128 | SQLITE_BLOB, /* 0x00 */ |
| 75129 | SQLITE_NULL, /* 0x01 */ |
| 75130 | SQLITE_TEXT, /* 0x02 */ |
| 75131 | SQLITE_NULL, /* 0x03 */ |
| @@ -75137,11 +75161,11 @@ | |
| 75161 | return aType[pVal->flags&MEM_AffMask]; |
| 75162 | } |
| 75163 | |
| 75164 | /* Make a copy of an sqlite3_value object |
| 75165 | */ |
| 75166 | SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value *pOrig){ |
| 75167 | sqlite3_value *pNew; |
| 75168 | if( pOrig==0 ) return 0; |
| 75169 | pNew = sqlite3_malloc( sizeof(*pNew) ); |
| 75170 | if( pNew==0 ) return 0; |
| 75171 | memset(pNew, 0, sizeof(*pNew)); |
| @@ -75160,11 +75184,11 @@ | |
| 75184 | } |
| 75185 | |
| 75186 | /* Destroy an sqlite3_value object previously obtained from |
| 75187 | ** sqlite3_value_dup(). |
| 75188 | */ |
| 75189 | SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value *pOld){ |
| 75190 | sqlite3ValueFree(pOld); |
| 75191 | } |
| 75192 | |
| 75193 | |
| 75194 | /**************************** sqlite3_result_ ******************************* |
| @@ -75203,21 +75227,21 @@ | |
| 75227 | xDel((void*)p); |
| 75228 | } |
| 75229 | if( pCtx ) sqlite3_result_error_toobig(pCtx); |
| 75230 | return SQLITE_TOOBIG; |
| 75231 | } |
| 75232 | SQLITE_API void SQLITE_APICALL sqlite3_result_blob( |
| 75233 | sqlite3_context *pCtx, |
| 75234 | const void *z, |
| 75235 | int n, |
| 75236 | void (*xDel)(void *) |
| 75237 | ){ |
| 75238 | assert( n>=0 ); |
| 75239 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75240 | setResultStrOrError(pCtx, z, n, 0, xDel); |
| 75241 | } |
| 75242 | SQLITE_API void SQLITE_APICALL sqlite3_result_blob64( |
| 75243 | sqlite3_context *pCtx, |
| 75244 | const void *z, |
| 75245 | sqlite3_uint64 n, |
| 75246 | void (*xDel)(void *) |
| 75247 | ){ |
| @@ -75227,56 +75251,56 @@ | |
| 75251 | (void)invokeValueDestructor(z, xDel, pCtx); |
| 75252 | }else{ |
| 75253 | setResultStrOrError(pCtx, z, (int)n, 0, xDel); |
| 75254 | } |
| 75255 | } |
| 75256 | SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context *pCtx, double rVal){ |
| 75257 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75258 | sqlite3VdbeMemSetDouble(pCtx->pOut, rVal); |
| 75259 | } |
| 75260 | SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context *pCtx, const char *z, int n){ |
| 75261 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75262 | pCtx->isError = SQLITE_ERROR; |
| 75263 | pCtx->fErrorOrAux = 1; |
| 75264 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF8, SQLITE_TRANSIENT); |
| 75265 | } |
| 75266 | #ifndef SQLITE_OMIT_UTF16 |
| 75267 | SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context *pCtx, const void *z, int n){ |
| 75268 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75269 | pCtx->isError = SQLITE_ERROR; |
| 75270 | pCtx->fErrorOrAux = 1; |
| 75271 | sqlite3VdbeMemSetStr(pCtx->pOut, z, n, SQLITE_UTF16NATIVE, SQLITE_TRANSIENT); |
| 75272 | } |
| 75273 | #endif |
| 75274 | SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context *pCtx, int iVal){ |
| 75275 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75276 | sqlite3VdbeMemSetInt64(pCtx->pOut, (i64)iVal); |
| 75277 | } |
| 75278 | SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context *pCtx, i64 iVal){ |
| 75279 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75280 | sqlite3VdbeMemSetInt64(pCtx->pOut, iVal); |
| 75281 | } |
| 75282 | SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context *pCtx){ |
| 75283 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75284 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75285 | } |
| 75286 | SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context *pCtx, unsigned int eSubtype){ |
| 75287 | Mem *pOut = pCtx->pOut; |
| 75288 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75289 | pOut->eSubtype = eSubtype & 0xff; |
| 75290 | pOut->flags |= MEM_Subtype; |
| 75291 | } |
| 75292 | SQLITE_API void SQLITE_APICALL sqlite3_result_text( |
| 75293 | sqlite3_context *pCtx, |
| 75294 | const char *z, |
| 75295 | int n, |
| 75296 | void (*xDel)(void *) |
| 75297 | ){ |
| 75298 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75299 | setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel); |
| 75300 | } |
| 75301 | SQLITE_API void SQLITE_APICALL sqlite3_result_text64( |
| 75302 | sqlite3_context *pCtx, |
| 75303 | const char *z, |
| 75304 | sqlite3_uint64 n, |
| 75305 | void (*xDel)(void *), |
| 75306 | unsigned char enc |
| @@ -75289,56 +75313,56 @@ | |
| 75313 | }else{ |
| 75314 | setResultStrOrError(pCtx, z, (int)n, enc, xDel); |
| 75315 | } |
| 75316 | } |
| 75317 | #ifndef SQLITE_OMIT_UTF16 |
| 75318 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16( |
| 75319 | sqlite3_context *pCtx, |
| 75320 | const void *z, |
| 75321 | int n, |
| 75322 | void (*xDel)(void *) |
| 75323 | ){ |
| 75324 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75325 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel); |
| 75326 | } |
| 75327 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16be( |
| 75328 | sqlite3_context *pCtx, |
| 75329 | const void *z, |
| 75330 | int n, |
| 75331 | void (*xDel)(void *) |
| 75332 | ){ |
| 75333 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75334 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel); |
| 75335 | } |
| 75336 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16le( |
| 75337 | sqlite3_context *pCtx, |
| 75338 | const void *z, |
| 75339 | int n, |
| 75340 | void (*xDel)(void *) |
| 75341 | ){ |
| 75342 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75343 | setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel); |
| 75344 | } |
| 75345 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75346 | SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context *pCtx, sqlite3_value *pValue){ |
| 75347 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75348 | sqlite3VdbeMemCopy(pCtx->pOut, pValue); |
| 75349 | } |
| 75350 | SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ |
| 75351 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75352 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, n); |
| 75353 | } |
| 75354 | SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context *pCtx, u64 n){ |
| 75355 | Mem *pOut = pCtx->pOut; |
| 75356 | assert( sqlite3_mutex_held(pOut->db->mutex) ); |
| 75357 | if( n>(u64)pOut->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 75358 | return SQLITE_TOOBIG; |
| 75359 | } |
| 75360 | sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n); |
| 75361 | return SQLITE_OK; |
| 75362 | } |
| 75363 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ |
| 75364 | pCtx->isError = errCode; |
| 75365 | pCtx->fErrorOrAux = 1; |
| 75366 | #ifdef SQLITE_DEBUG |
| 75367 | if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode; |
| 75368 | #endif |
| @@ -75347,20 +75371,20 @@ | |
| 75371 | SQLITE_UTF8, SQLITE_STATIC); |
| 75372 | } |
| 75373 | } |
| 75374 | |
| 75375 | /* Force an SQLITE_TOOBIG error. */ |
| 75376 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context *pCtx){ |
| 75377 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75378 | pCtx->isError = SQLITE_TOOBIG; |
| 75379 | pCtx->fErrorOrAux = 1; |
| 75380 | sqlite3VdbeMemSetStr(pCtx->pOut, "string or blob too big", -1, |
| 75381 | SQLITE_UTF8, SQLITE_STATIC); |
| 75382 | } |
| 75383 | |
| 75384 | /* An SQLITE_NOMEM error. */ |
| 75385 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context *pCtx){ |
| 75386 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75387 | sqlite3VdbeMemSetNull(pCtx->pOut); |
| 75388 | pCtx->isError = SQLITE_NOMEM_BKPT; |
| 75389 | pCtx->fErrorOrAux = 1; |
| 75390 | sqlite3OomFault(pCtx->pOut->db); |
| @@ -75528,11 +75552,11 @@ | |
| 75552 | /* |
| 75553 | ** This is the top-level implementation of sqlite3_step(). Call |
| 75554 | ** sqlite3Step() to do most of the work. If a schema error occurs, |
| 75555 | ** call sqlite3Reprepare() and try again. |
| 75556 | */ |
| 75557 | SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt *pStmt){ |
| 75558 | int rc = SQLITE_OK; /* Result from sqlite3Step() */ |
| 75559 | int rc2 = SQLITE_OK; /* Result from sqlite3Reprepare() */ |
| 75560 | Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */ |
| 75561 | int cnt = 0; /* Counter to prevent infinite loop of reprepares */ |
| 75562 | sqlite3 *db; /* The database connection */ |
| @@ -75579,11 +75603,11 @@ | |
| 75603 | |
| 75604 | /* |
| 75605 | ** Extract the user data from a sqlite3_context structure and return a |
| 75606 | ** pointer to it. |
| 75607 | */ |
| 75608 | SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context *p){ |
| 75609 | assert( p && p->pFunc ); |
| 75610 | return p->pFunc->pUserData; |
| 75611 | } |
| 75612 | |
| 75613 | /* |
| @@ -75594,11 +75618,11 @@ | |
| 75618 | ** returns a copy of the pointer to the database connection (the 1st |
| 75619 | ** parameter) of the sqlite3_create_function() and |
| 75620 | ** sqlite3_create_function16() routines that originally registered the |
| 75621 | ** application defined function. |
| 75622 | */ |
| 75623 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context *p){ |
| 75624 | assert( p && p->pOut ); |
| 75625 | return p->pOut->db; |
| 75626 | } |
| 75627 | |
| 75628 | /* |
| @@ -75670,11 +75694,11 @@ | |
| 75694 | /* |
| 75695 | ** Allocate or return the aggregate context for a user function. A new |
| 75696 | ** context is allocated on the first call. Subsequent calls return the |
| 75697 | ** same context that was returned on prior calls. |
| 75698 | */ |
| 75699 | SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context *p, int nByte){ |
| 75700 | assert( p && p->pFunc && p->pFunc->xFinalize ); |
| 75701 | assert( sqlite3_mutex_held(p->pOut->db->mutex) ); |
| 75702 | testcase( nByte<0 ); |
| 75703 | if( (p->pMem->flags & MEM_Agg)==0 ){ |
| 75704 | return createAggContext(p, nByte); |
| @@ -75685,11 +75709,11 @@ | |
| 75709 | |
| 75710 | /* |
| 75711 | ** Return the auxiliary data pointer, if any, for the iArg'th argument to |
| 75712 | ** the user-function defined by pCtx. |
| 75713 | */ |
| 75714 | SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){ |
| 75715 | AuxData *pAuxData; |
| 75716 | |
| 75717 | assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) ); |
| 75718 | #if SQLITE_ENABLE_STAT3_OR_STAT4 |
| 75719 | if( pCtx->pVdbe==0 ) return 0; |
| @@ -75706,11 +75730,11 @@ | |
| 75730 | /* |
| 75731 | ** Set the auxiliary data pointer and delete function, for the iArg'th |
| 75732 | ** argument to the user-function defined by pCtx. Any previous value is |
| 75733 | ** deleted by calling the delete function specified when it was set. |
| 75734 | */ |
| 75735 | SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata( |
| 75736 | sqlite3_context *pCtx, |
| 75737 | int iArg, |
| 75738 | void *pAux, |
| 75739 | void (*xDelete)(void*) |
| 75740 | ){ |
| @@ -75761,29 +75785,29 @@ | |
| 75785 | ** This function is deprecated. Do not use it for new code. It is |
| 75786 | ** provide only to avoid breaking legacy code. New aggregate function |
| 75787 | ** implementations should keep their own counts within their aggregate |
| 75788 | ** context. |
| 75789 | */ |
| 75790 | SQLITE_API int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context *p){ |
| 75791 | assert( p && p->pMem && p->pFunc && p->pFunc->xFinalize ); |
| 75792 | return p->pMem->n; |
| 75793 | } |
| 75794 | #endif |
| 75795 | |
| 75796 | /* |
| 75797 | ** Return the number of columns in the result set for the statement pStmt. |
| 75798 | */ |
| 75799 | SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt){ |
| 75800 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75801 | return pVm ? pVm->nResColumn : 0; |
| 75802 | } |
| 75803 | |
| 75804 | /* |
| 75805 | ** Return the number of values available from the current row of the |
| 75806 | ** currently executing statement pStmt. |
| 75807 | */ |
| 75808 | SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt){ |
| 75809 | Vdbe *pVm = (Vdbe *)pStmt; |
| 75810 | if( pVm==0 || pVm->pResultSet==0 ) return 0; |
| 75811 | return pVm->nResColumn; |
| 75812 | } |
| 75813 | |
| @@ -75882,67 +75906,67 @@ | |
| 75906 | |
| 75907 | /**************************** sqlite3_column_ ******************************* |
| 75908 | ** The following routines are used to access elements of the current row |
| 75909 | ** in the result set. |
| 75910 | */ |
| 75911 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt *pStmt, int i){ |
| 75912 | const void *val; |
| 75913 | val = sqlite3_value_blob( columnMem(pStmt,i) ); |
| 75914 | /* Even though there is no encoding conversion, value_blob() might |
| 75915 | ** need to call malloc() to expand the result of a zeroblob() |
| 75916 | ** expression. |
| 75917 | */ |
| 75918 | columnMallocFailure(pStmt); |
| 75919 | return val; |
| 75920 | } |
| 75921 | SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){ |
| 75922 | int val = sqlite3_value_bytes( columnMem(pStmt,i) ); |
| 75923 | columnMallocFailure(pStmt); |
| 75924 | return val; |
| 75925 | } |
| 75926 | SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt *pStmt, int i){ |
| 75927 | int val = sqlite3_value_bytes16( columnMem(pStmt,i) ); |
| 75928 | columnMallocFailure(pStmt); |
| 75929 | return val; |
| 75930 | } |
| 75931 | SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt *pStmt, int i){ |
| 75932 | double val = sqlite3_value_double( columnMem(pStmt,i) ); |
| 75933 | columnMallocFailure(pStmt); |
| 75934 | return val; |
| 75935 | } |
| 75936 | SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt *pStmt, int i){ |
| 75937 | int val = sqlite3_value_int( columnMem(pStmt,i) ); |
| 75938 | columnMallocFailure(pStmt); |
| 75939 | return val; |
| 75940 | } |
| 75941 | SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt *pStmt, int i){ |
| 75942 | sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) ); |
| 75943 | columnMallocFailure(pStmt); |
| 75944 | return val; |
| 75945 | } |
| 75946 | SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt *pStmt, int i){ |
| 75947 | const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) ); |
| 75948 | columnMallocFailure(pStmt); |
| 75949 | return val; |
| 75950 | } |
| 75951 | SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt *pStmt, int i){ |
| 75952 | Mem *pOut = columnMem(pStmt, i); |
| 75953 | if( pOut->flags&MEM_Static ){ |
| 75954 | pOut->flags &= ~MEM_Static; |
| 75955 | pOut->flags |= MEM_Ephem; |
| 75956 | } |
| 75957 | columnMallocFailure(pStmt); |
| 75958 | return (sqlite3_value *)pOut; |
| 75959 | } |
| 75960 | #ifndef SQLITE_OMIT_UTF16 |
| 75961 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt *pStmt, int i){ |
| 75962 | const void *val = sqlite3_value_text16( columnMem(pStmt,i) ); |
| 75963 | columnMallocFailure(pStmt); |
| 75964 | return val; |
| 75965 | } |
| 75966 | #endif /* SQLITE_OMIT_UTF16 */ |
| 75967 | SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt *pStmt, int i){ |
| 75968 | int iType = sqlite3_value_type( columnMem(pStmt,i) ); |
| 75969 | columnMallocFailure(pStmt); |
| 75970 | return iType; |
| 75971 | } |
| 75972 | |
| @@ -76002,16 +76026,16 @@ | |
| 76026 | |
| 76027 | /* |
| 76028 | ** Return the name of the Nth column of the result set returned by SQL |
| 76029 | ** statement pStmt. |
| 76030 | */ |
| 76031 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt *pStmt, int N){ |
| 76032 | return columnName( |
| 76033 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_NAME); |
| 76034 | } |
| 76035 | #ifndef SQLITE_OMIT_UTF16 |
| 76036 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt *pStmt, int N){ |
| 76037 | return columnName( |
| 76038 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_NAME); |
| 76039 | } |
| 76040 | #endif |
| 76041 | |
| @@ -76027,16 +76051,16 @@ | |
| 76051 | #ifndef SQLITE_OMIT_DECLTYPE |
| 76052 | /* |
| 76053 | ** Return the column declaration type (if applicable) of the 'i'th column |
| 76054 | ** of the result set of SQL statement pStmt. |
| 76055 | */ |
| 76056 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt *pStmt, int N){ |
| 76057 | return columnName( |
| 76058 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DECLTYPE); |
| 76059 | } |
| 76060 | #ifndef SQLITE_OMIT_UTF16 |
| 76061 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt *pStmt, int N){ |
| 76062 | return columnName( |
| 76063 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DECLTYPE); |
| 76064 | } |
| 76065 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76066 | #endif /* SQLITE_OMIT_DECLTYPE */ |
| @@ -76045,16 +76069,16 @@ | |
| 76069 | /* |
| 76070 | ** Return the name of the database from which a result column derives. |
| 76071 | ** NULL is returned if the result column is an expression or constant or |
| 76072 | ** anything else which is not an unambiguous reference to a database column. |
| 76073 | */ |
| 76074 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt *pStmt, int N){ |
| 76075 | return columnName( |
| 76076 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_DATABASE); |
| 76077 | } |
| 76078 | #ifndef SQLITE_OMIT_UTF16 |
| 76079 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt *pStmt, int N){ |
| 76080 | return columnName( |
| 76081 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_DATABASE); |
| 76082 | } |
| 76083 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76084 | |
| @@ -76061,16 +76085,16 @@ | |
| 76085 | /* |
| 76086 | ** Return the name of the table from which a result column derives. |
| 76087 | ** NULL is returned if the result column is an expression or constant or |
| 76088 | ** anything else which is not an unambiguous reference to a database column. |
| 76089 | */ |
| 76090 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt *pStmt, int N){ |
| 76091 | return columnName( |
| 76092 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_TABLE); |
| 76093 | } |
| 76094 | #ifndef SQLITE_OMIT_UTF16 |
| 76095 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt *pStmt, int N){ |
| 76096 | return columnName( |
| 76097 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_TABLE); |
| 76098 | } |
| 76099 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76100 | |
| @@ -76077,16 +76101,16 @@ | |
| 76101 | /* |
| 76102 | ** Return the name of the table column from which a result column derives. |
| 76103 | ** NULL is returned if the result column is an expression or constant or |
| 76104 | ** anything else which is not an unambiguous reference to a database column. |
| 76105 | */ |
| 76106 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt *pStmt, int N){ |
| 76107 | return columnName( |
| 76108 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text, COLNAME_COLUMN); |
| 76109 | } |
| 76110 | #ifndef SQLITE_OMIT_UTF16 |
| 76111 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt *pStmt, int N){ |
| 76112 | return columnName( |
| 76113 | pStmt, N, (const void*(*)(Mem*))sqlite3_value_text16, COLNAME_COLUMN); |
| 76114 | } |
| 76115 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76116 | #endif /* SQLITE_ENABLE_COLUMN_METADATA */ |
| @@ -76183,11 +76207,11 @@ | |
| 76207 | |
| 76208 | |
| 76209 | /* |
| 76210 | ** Bind a blob value to an SQL statement variable. |
| 76211 | */ |
| 76212 | SQLITE_API int SQLITE_APICALL sqlite3_bind_blob( |
| 76213 | sqlite3_stmt *pStmt, |
| 76214 | int i, |
| 76215 | const void *zData, |
| 76216 | int nData, |
| 76217 | void (*xDel)(void*) |
| @@ -76195,11 +76219,11 @@ | |
| 76219 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76220 | if( nData<0 ) return SQLITE_MISUSE_BKPT; |
| 76221 | #endif |
| 76222 | return bindText(pStmt, i, zData, nData, xDel, 0); |
| 76223 | } |
| 76224 | SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64( |
| 76225 | sqlite3_stmt *pStmt, |
| 76226 | int i, |
| 76227 | const void *zData, |
| 76228 | sqlite3_uint64 nData, |
| 76229 | void (*xDel)(void*) |
| @@ -76209,52 +76233,52 @@ | |
| 76233 | return invokeValueDestructor(zData, xDel, 0); |
| 76234 | }else{ |
| 76235 | return bindText(pStmt, i, zData, (int)nData, xDel, 0); |
| 76236 | } |
| 76237 | } |
| 76238 | SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){ |
| 76239 | int rc; |
| 76240 | Vdbe *p = (Vdbe *)pStmt; |
| 76241 | rc = vdbeUnbind(p, i); |
| 76242 | if( rc==SQLITE_OK ){ |
| 76243 | sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue); |
| 76244 | sqlite3_mutex_leave(p->db->mutex); |
| 76245 | } |
| 76246 | return rc; |
| 76247 | } |
| 76248 | SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt *p, int i, int iValue){ |
| 76249 | return sqlite3_bind_int64(p, i, (i64)iValue); |
| 76250 | } |
| 76251 | SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){ |
| 76252 | int rc; |
| 76253 | Vdbe *p = (Vdbe *)pStmt; |
| 76254 | rc = vdbeUnbind(p, i); |
| 76255 | if( rc==SQLITE_OK ){ |
| 76256 | sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue); |
| 76257 | sqlite3_mutex_leave(p->db->mutex); |
| 76258 | } |
| 76259 | return rc; |
| 76260 | } |
| 76261 | SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt *pStmt, int i){ |
| 76262 | int rc; |
| 76263 | Vdbe *p = (Vdbe*)pStmt; |
| 76264 | rc = vdbeUnbind(p, i); |
| 76265 | if( rc==SQLITE_OK ){ |
| 76266 | sqlite3_mutex_leave(p->db->mutex); |
| 76267 | } |
| 76268 | return rc; |
| 76269 | } |
| 76270 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text( |
| 76271 | sqlite3_stmt *pStmt, |
| 76272 | int i, |
| 76273 | const char *zData, |
| 76274 | int nData, |
| 76275 | void (*xDel)(void*) |
| 76276 | ){ |
| 76277 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8); |
| 76278 | } |
| 76279 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text64( |
| 76280 | sqlite3_stmt *pStmt, |
| 76281 | int i, |
| 76282 | const char *zData, |
| 76283 | sqlite3_uint64 nData, |
| 76284 | void (*xDel)(void*), |
| @@ -76267,21 +76291,21 @@ | |
| 76291 | if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; |
| 76292 | return bindText(pStmt, i, zData, (int)nData, xDel, enc); |
| 76293 | } |
| 76294 | } |
| 76295 | #ifndef SQLITE_OMIT_UTF16 |
| 76296 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text16( |
| 76297 | sqlite3_stmt *pStmt, |
| 76298 | int i, |
| 76299 | const void *zData, |
| 76300 | int nData, |
| 76301 | void (*xDel)(void*) |
| 76302 | ){ |
| 76303 | return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE); |
| 76304 | } |
| 76305 | #endif /* SQLITE_OMIT_UTF16 */ |
| 76306 | SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ |
| 76307 | int rc; |
| 76308 | switch( sqlite3_value_type((sqlite3_value*)pValue) ){ |
| 76309 | case SQLITE_INTEGER: { |
| 76310 | rc = sqlite3_bind_int64(pStmt, i, pValue->u.i); |
| 76311 | break; |
| @@ -76308,21 +76332,21 @@ | |
| 76332 | break; |
| 76333 | } |
| 76334 | } |
| 76335 | return rc; |
| 76336 | } |
| 76337 | SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt *pStmt, int i, int n){ |
| 76338 | int rc; |
| 76339 | Vdbe *p = (Vdbe *)pStmt; |
| 76340 | rc = vdbeUnbind(p, i); |
| 76341 | if( rc==SQLITE_OK ){ |
| 76342 | sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n); |
| 76343 | sqlite3_mutex_leave(p->db->mutex); |
| 76344 | } |
| 76345 | return rc; |
| 76346 | } |
| 76347 | SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt *pStmt, int i, sqlite3_uint64 n){ |
| 76348 | int rc; |
| 76349 | Vdbe *p = (Vdbe *)pStmt; |
| 76350 | sqlite3_mutex_enter(p->db->mutex); |
| 76351 | if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){ |
| 76352 | rc = SQLITE_TOOBIG; |
| @@ -76337,11 +76361,11 @@ | |
| 76361 | |
| 76362 | /* |
| 76363 | ** Return the number of wildcards that can be potentially bound to. |
| 76364 | ** This routine is added to support DBD::SQLite. |
| 76365 | */ |
| 76366 | SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt *pStmt){ |
| 76367 | Vdbe *p = (Vdbe*)pStmt; |
| 76368 | return p ? p->nVar : 0; |
| 76369 | } |
| 76370 | |
| 76371 | /* |
| @@ -76348,11 +76372,11 @@ | |
| 76372 | ** Return the name of a wildcard parameter. Return NULL if the index |
| 76373 | ** is out of range or if the wildcard is unnamed. |
| 76374 | ** |
| 76375 | ** The result is always UTF-8. |
| 76376 | */ |
| 76377 | SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt *pStmt, int i){ |
| 76378 | Vdbe *p = (Vdbe*)pStmt; |
| 76379 | if( p==0 || i<1 || i>p->nzVar ){ |
| 76380 | return 0; |
| 76381 | } |
| 76382 | return p->azVar[i-1]; |
| @@ -76376,11 +76400,11 @@ | |
| 76400 | } |
| 76401 | } |
| 76402 | } |
| 76403 | return 0; |
| 76404 | } |
| 76405 | SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt *pStmt, const char *zName){ |
| 76406 | return sqlite3VdbeParameterIndex((Vdbe*)pStmt, zName, sqlite3Strlen30(zName)); |
| 76407 | } |
| 76408 | |
| 76409 | /* |
| 76410 | ** Transfer all bindings from the first statement over to the second. |
| @@ -76410,11 +76434,11 @@ | |
| 76434 | ** |
| 76435 | ** If the two statements contain a different number of bindings, then |
| 76436 | ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise |
| 76437 | ** SQLITE_OK is returned. |
| 76438 | */ |
| 76439 | SQLITE_API int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt *pFromStmt, sqlite3_stmt *pToStmt){ |
| 76440 | Vdbe *pFrom = (Vdbe*)pFromStmt; |
| 76441 | Vdbe *pTo = (Vdbe*)pToStmt; |
| 76442 | if( pFrom->nVar!=pTo->nVar ){ |
| 76443 | return SQLITE_ERROR; |
| 76444 | } |
| @@ -76432,26 +76456,26 @@ | |
| 76456 | ** Return the sqlite3* database handle to which the prepared statement given |
| 76457 | ** in the argument belongs. This is the same database handle that was |
| 76458 | ** the first argument to the sqlite3_prepare() that was used to create |
| 76459 | ** the statement in the first place. |
| 76460 | */ |
| 76461 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt *pStmt){ |
| 76462 | return pStmt ? ((Vdbe*)pStmt)->db : 0; |
| 76463 | } |
| 76464 | |
| 76465 | /* |
| 76466 | ** Return true if the prepared statement is guaranteed to not modify the |
| 76467 | ** database. |
| 76468 | */ |
| 76469 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt){ |
| 76470 | return pStmt ? ((Vdbe*)pStmt)->readOnly : 1; |
| 76471 | } |
| 76472 | |
| 76473 | /* |
| 76474 | ** Return true if the prepared statement is in need of being reset. |
| 76475 | */ |
| 76476 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt *pStmt){ |
| 76477 | Vdbe *v = (Vdbe*)pStmt; |
| 76478 | return v!=0 && v->pc>=0 && v->magic==VDBE_MAGIC_RUN; |
| 76479 | } |
| 76480 | |
| 76481 | /* |
| @@ -76458,11 +76482,11 @@ | |
| 76482 | ** Return a pointer to the next prepared statement after pStmt associated |
| 76483 | ** with database connection pDb. If pStmt is NULL, return the first |
| 76484 | ** prepared statement for the database connection. Return NULL if there |
| 76485 | ** are no more. |
| 76486 | */ |
| 76487 | SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt){ |
| 76488 | sqlite3_stmt *pNext; |
| 76489 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76490 | if( !sqlite3SafetyCheckOk(pDb) ){ |
| 76491 | (void)SQLITE_MISUSE_BKPT; |
| 76492 | return 0; |
| @@ -76479,11 +76503,11 @@ | |
| 76503 | } |
| 76504 | |
| 76505 | /* |
| 76506 | ** Return the value of a status counter for a prepared statement |
| 76507 | */ |
| 76508 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt *pStmt, int op, int resetFlag){ |
| 76509 | Vdbe *pVdbe = (Vdbe*)pStmt; |
| 76510 | u32 v; |
| 76511 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 76512 | if( !pStmt ){ |
| 76513 | (void)SQLITE_MISUSE_BKPT; |
| @@ -76496,11 +76520,11 @@ | |
| 76520 | } |
| 76521 | |
| 76522 | /* |
| 76523 | ** Return the SQL associated with a prepared statement |
| 76524 | */ |
| 76525 | SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt){ |
| 76526 | Vdbe *p = (Vdbe *)pStmt; |
| 76527 | return p ? p->zSql : 0; |
| 76528 | } |
| 76529 | |
| 76530 | /* |
| @@ -76510,11 +76534,11 @@ | |
| 76534 | ** freeing the returned string by passing it to sqlite3_free(). |
| 76535 | ** |
| 76536 | ** The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of |
| 76537 | ** expanded bound parameters. |
| 76538 | */ |
| 76539 | SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt){ |
| 76540 | #ifdef SQLITE_OMIT_TRACE |
| 76541 | return 0; |
| 76542 | #else |
| 76543 | char *z = 0; |
| 76544 | const char *zSql = sqlite3_sql(pStmt); |
| @@ -76552,11 +76576,11 @@ | |
| 76576 | |
| 76577 | /* |
| 76578 | ** This function is called from within a pre-update callback to retrieve |
| 76579 | ** a field of the row currently being updated or deleted. |
| 76580 | */ |
| 76581 | SQLITE_API int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76582 | PreUpdate *p = db->pPreUpdate; |
| 76583 | int rc = SQLITE_OK; |
| 76584 | |
| 76585 | /* Test that this call is being made from within an SQLITE_DELETE or |
| 76586 | ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ |
| @@ -76607,11 +76631,11 @@ | |
| 76631 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76632 | /* |
| 76633 | ** This function is called from within a pre-update callback to retrieve |
| 76634 | ** the number of columns in the row being updated, deleted or inserted. |
| 76635 | */ |
| 76636 | SQLITE_API int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *db){ |
| 76637 | PreUpdate *p = db->pPreUpdate; |
| 76638 | return (p ? p->keyinfo.nField : 0); |
| 76639 | } |
| 76640 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76641 | |
| @@ -76625,11 +76649,11 @@ | |
| 76649 | ** top-level trigger etc.). |
| 76650 | ** |
| 76651 | ** For the purposes of the previous paragraph, a foreign key CASCADE, SET NULL |
| 76652 | ** or SET DEFAULT action is considered a trigger. |
| 76653 | */ |
| 76654 | SQLITE_API int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *db){ |
| 76655 | PreUpdate *p = db->pPreUpdate; |
| 76656 | return (p ? p->v->nFrame : 0); |
| 76657 | } |
| 76658 | #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ |
| 76659 | |
| @@ -76636,11 +76660,11 @@ | |
| 76660 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 76661 | /* |
| 76662 | ** This function is called from within a pre-update callback to retrieve |
| 76663 | ** a field of the row currently being updated or inserted. |
| 76664 | */ |
| 76665 | SQLITE_API int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppValue){ |
| 76666 | PreUpdate *p = db->pPreUpdate; |
| 76667 | int rc = SQLITE_OK; |
| 76668 | Mem *pMem; |
| 76669 | |
| 76670 | if( !p || p->op==SQLITE_DELETE ){ |
| @@ -76710,11 +76734,11 @@ | |
| 76734 | |
| 76735 | #ifdef SQLITE_ENABLE_STMT_SCANSTATUS |
| 76736 | /* |
| 76737 | ** Return status data for a single loop within query pStmt. |
| 76738 | */ |
| 76739 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus( |
| 76740 | sqlite3_stmt *pStmt, /* Prepared statement being queried */ |
| 76741 | int idx, /* Index of loop to report on */ |
| 76742 | int iScanStatusOp, /* Which metric to return */ |
| 76743 | void *pOut /* OUT: Write the answer here */ |
| 76744 | ){ |
| @@ -76769,11 +76793,11 @@ | |
| 76793 | } |
| 76794 | |
| 76795 | /* |
| 76796 | ** Zero all counters associated with the sqlite3_stmt_scanstatus() data. |
| 76797 | */ |
| 76798 | SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt *pStmt){ |
| 76799 | Vdbe *p = (Vdbe*)pStmt; |
| 76800 | memset(p->anExec, 0, p->nOp * sizeof(i64)); |
| 76801 | } |
| 76802 | #endif /* SQLITE_ENABLE_STMT_SCANSTATUS */ |
| 76803 | |
| @@ -77296,11 +77320,11 @@ | |
| 77320 | ** Try to convert the type of a function argument or a result column |
| 77321 | ** into a numeric representation. Use either INTEGER or REAL whichever |
| 77322 | ** is appropriate. But only do the conversion if it is possible without |
| 77323 | ** loss of information and return the revised type of the argument. |
| 77324 | */ |
| 77325 | SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value *pVal){ |
| 77326 | int eType = sqlite3_value_type(pVal); |
| 77327 | if( eType==SQLITE_TEXT ){ |
| 77328 | Mem *pMem = (Mem*)pVal; |
| 77329 | applyNumericAffinity(pMem, 0); |
| 77330 | eType = sqlite3_value_type(pVal); |
| @@ -84148,11 +84172,11 @@ | |
| 84172 | } |
| 84173 | |
| 84174 | /* |
| 84175 | ** Open a blob handle. |
| 84176 | */ |
| 84177 | SQLITE_API int SQLITE_APICALL sqlite3_blob_open( |
| 84178 | sqlite3* db, /* The database connection */ |
| 84179 | const char *zDb, /* The attached database containing the blob */ |
| 84180 | const char *zTable, /* The table containing the blob */ |
| 84181 | const char *zColumn, /* The column containing the blob */ |
| 84182 | sqlite_int64 iRow, /* The row containing the glob */ |
| @@ -84389,11 +84413,11 @@ | |
| 84413 | |
| 84414 | /* |
| 84415 | ** Close a blob handle that was previously created using |
| 84416 | ** sqlite3_blob_open(). |
| 84417 | */ |
| 84418 | SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *pBlob){ |
| 84419 | Incrblob *p = (Incrblob *)pBlob; |
| 84420 | int rc; |
| 84421 | sqlite3 *db; |
| 84422 | |
| 84423 | if( p ){ |
| @@ -84482,28 +84506,28 @@ | |
| 84506 | } |
| 84507 | |
| 84508 | /* |
| 84509 | ** Read data from a blob handle. |
| 84510 | */ |
| 84511 | SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *pBlob, void *z, int n, int iOffset){ |
| 84512 | return blobReadWrite(pBlob, z, n, iOffset, sqlite3BtreeData); |
| 84513 | } |
| 84514 | |
| 84515 | /* |
| 84516 | ** Write data to a blob handle. |
| 84517 | */ |
| 84518 | SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *pBlob, const void *z, int n, int iOffset){ |
| 84519 | return blobReadWrite(pBlob, (void *)z, n, iOffset, sqlite3BtreePutData); |
| 84520 | } |
| 84521 | |
| 84522 | /* |
| 84523 | ** Query a blob handle for the size of the data. |
| 84524 | ** |
| 84525 | ** The Incrblob.nByte field is fixed for the lifetime of the Incrblob |
| 84526 | ** so no mutex is required for access. |
| 84527 | */ |
| 84528 | SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *pBlob){ |
| 84529 | Incrblob *p = (Incrblob *)pBlob; |
| 84530 | return (p && p->pStmt) ? p->nByte : 0; |
| 84531 | } |
| 84532 | |
| 84533 | /* |
| @@ -84514,11 +84538,11 @@ | |
| 84538 | ** contain a blob or text value, then an error code is returned and the |
| 84539 | ** database handle error code and message set. If this happens, then all |
| 84540 | ** subsequent calls to sqlite3_blob_xxx() functions (except blob_close()) |
| 84541 | ** immediately return SQLITE_ABORT. |
| 84542 | */ |
| 84543 | SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *pBlob, sqlite3_int64 iRow){ |
| 84544 | int rc; |
| 84545 | Incrblob *p = (Incrblob *)pBlob; |
| 84546 | sqlite3 *db; |
| 84547 | |
| 84548 | if( p==0 ) return SQLITE_MISUSE_BKPT; |
| @@ -97118,11 +97142,11 @@ | |
| 97142 | ** and attempts to write the column will be ignored. |
| 97143 | ** |
| 97144 | ** Setting the auth function to NULL disables this hook. The default |
| 97145 | ** setting of the auth function is NULL. |
| 97146 | */ |
| 97147 | SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer( |
| 97148 | sqlite3 *db, |
| 97149 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 97150 | void *pArg |
| 97151 | ){ |
| 97152 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -97162,10 +97186,11 @@ | |
| 97186 | ){ |
| 97187 | sqlite3 *db = pParse->db; /* Database handle */ |
| 97188 | char *zDb = db->aDb[iDb].zName; /* Name of attached database */ |
| 97189 | int rc; /* Auth callback return code */ |
| 97190 | |
| 97191 | if( db->init.busy ) return SQLITE_OK; |
| 97192 | rc = db->xAuth(db->pAuthArg, SQLITE_READ, zTab,zCol,zDb,pParse->zAuthContext |
| 97193 | #ifdef SQLITE_USER_AUTHENTICATION |
| 97194 | ,db->auth.zAuthUser |
| 97195 | #endif |
| 97196 | ); |
| @@ -103880,18 +103905,18 @@ | |
| 103905 | } |
| 103906 | |
| 103907 | /* |
| 103908 | ** The sqlite3_strglob() interface. |
| 103909 | */ |
| 103910 | SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlobPattern, const char *zString){ |
| 103911 | return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[')==0; |
| 103912 | } |
| 103913 | |
| 103914 | /* |
| 103915 | ** The sqlite3_strlike() interface. |
| 103916 | */ |
| 103917 | SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){ |
| 103918 | return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc)==0; |
| 103919 | } |
| 103920 | |
| 103921 | /* |
| 103922 | ** Count the number of times that the LIKE operator (or GLOB which is |
| @@ -108583,11 +108608,11 @@ | |
| 108608 | ** If the SQL is a query, then for each row in the query result |
| 108609 | ** the xCallback() function is called. pArg becomes the first |
| 108610 | ** argument to xCallback(). If xCallback=NULL then no callback |
| 108611 | ** is invoked, even for queries. |
| 108612 | */ |
| 108613 | SQLITE_API int SQLITE_APICALL sqlite3_exec( |
| 108614 | sqlite3 *db, /* The database on which the SQL executes */ |
| 108615 | const char *zSql, /* The SQL to be executed */ |
| 108616 | sqlite3_callback xCallback, /* Invoke this callback routine */ |
| 108617 | void *pArg, /* First argument to xCallback() */ |
| 108618 | char **pzErrMsg /* Write error messages here */ |
| @@ -108974,16 +108999,17 @@ | |
| 108999 | sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64); |
| 109000 | const char *(*uri_parameter)(const char*,const char*); |
| 109001 | char *(*vsnprintf)(int,char*,const char*,va_list); |
| 109002 | int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*); |
| 109003 | /* Version 3.8.7 and later */ |
| 109004 | int (*auto_extension)(int(*)(sqlite3*,char**,const sqlite3_api_routines*)); |
| 109005 | int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64, |
| 109006 | void(*)(void*)); |
| 109007 | int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64, |
| 109008 | void(*)(void*),unsigned char); |
| 109009 | int (*cancel_auto_extension)(int(*)(sqlite3*,char**, |
| 109010 | const sqlite3_api_routines*)); |
| 109011 | int (*load_extension)(sqlite3*,const char*,const char*,char**); |
| 109012 | void *(*malloc64)(sqlite3_uint64); |
| 109013 | sqlite3_uint64 (*msize)(void*); |
| 109014 | void *(*realloc64)(void*,sqlite3_uint64); |
| 109015 | void (*reset_auto_extension)(void); |
| @@ -109008,10 +109034,20 @@ | |
| 109034 | int (*system_errno)(sqlite3*); |
| 109035 | /* Version 3.14.0 and later */ |
| 109036 | int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*); |
| 109037 | char *(*expanded_sql)(sqlite3_stmt*); |
| 109038 | }; |
| 109039 | |
| 109040 | /* |
| 109041 | ** This is the function signature used for all extension entry points. It |
| 109042 | ** is also defined in the file "loadext.c". |
| 109043 | */ |
| 109044 | typedef int (*sqlite3_loadext_entry)( |
| 109045 | sqlite3 *db, /* Handle to the database. */ |
| 109046 | char **pzErrMsg, /* Used to set error string on failure. */ |
| 109047 | const sqlite3_api_routines *pThunk /* Extension API function pointers. */ |
| 109048 | ); |
| 109049 | |
| 109050 | /* |
| 109051 | ** The following macros redefine the API routines so that they are |
| 109052 | ** redirected through the global sqlite3_api structure. |
| 109053 | ** |
| @@ -109280,10 +109316,18 @@ | |
| 109316 | /************** Continuing where we left off in loadext.c ********************/ |
| 109317 | /* #include "sqliteInt.h" */ |
| 109318 | /* #include <string.h> */ |
| 109319 | |
| 109320 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 109321 | /* |
| 109322 | ** This is the function signature used for all extension entry points. |
| 109323 | */ |
| 109324 | typedef int (*sqlite3_loadext_entry)( |
| 109325 | sqlite3 *db, /* Handle to the database. */ |
| 109326 | char **pzErrMsg, /* Used to set error string on failure. */ |
| 109327 | const sqlite3_api_routines *pThunk /* Extension API function pointers. */ |
| 109328 | ); |
| 109329 | |
| 109330 | /* |
| 109331 | ** Some API routines are omitted when various features are |
| 109332 | ** excluded from a build of SQLite. Substitute a NULL pointer |
| 109333 | ** for any missing APIs. |
| @@ -109369,10 +109413,14 @@ | |
| 109413 | #define sqlite3_blob_open 0 |
| 109414 | #define sqlite3_blob_read 0 |
| 109415 | #define sqlite3_blob_write 0 |
| 109416 | #define sqlite3_blob_reopen 0 |
| 109417 | #endif |
| 109418 | |
| 109419 | #if defined(SQLITE_OMIT_TRACE) |
| 109420 | # define sqlite3_trace_v2 0 |
| 109421 | #endif |
| 109422 | |
| 109423 | /* |
| 109424 | ** The following structure contains pointers to all SQLite API routines. |
| 109425 | ** A pointer to this structure is passed into extensions when they are |
| 109426 | ** loaded so that the extension can make calls back into the SQLite |
| @@ -109675,11 +109723,14 @@ | |
| 109723 | /* Version 3.10.0 and later */ |
| 109724 | sqlite3_status64, |
| 109725 | sqlite3_strlike, |
| 109726 | sqlite3_db_cacheflush, |
| 109727 | /* Version 3.12.0 and later */ |
| 109728 | sqlite3_system_errno, |
| 109729 | /* Version 3.14.0 and later */ |
| 109730 | sqlite3_trace_v2, |
| 109731 | sqlite3_expanded_sql |
| 109732 | }; |
| 109733 | |
| 109734 | /* |
| 109735 | ** Attempt to load an SQLite extension library contained in the file |
| 109736 | ** zFile. The entry point is zProc. zProc may be 0 in which case a |
| @@ -109698,11 +109749,11 @@ | |
| 109749 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 109750 | char **pzErrMsg /* Put error message here if not 0 */ |
| 109751 | ){ |
| 109752 | sqlite3_vfs *pVfs = db->pVfs; |
| 109753 | void *handle; |
| 109754 | sqlite3_loadext_entry xInit; |
| 109755 | char *zErrmsg = 0; |
| 109756 | const char *zEntry; |
| 109757 | char *zAltEntry = 0; |
| 109758 | void **aHandle; |
| 109759 | u64 nMsg = 300 + sqlite3Strlen30(zFile); |
| @@ -109757,12 +109808,11 @@ | |
| 109808 | sqlite3OsDlError(pVfs, nMsg-1, zErrmsg); |
| 109809 | } |
| 109810 | } |
| 109811 | return SQLITE_ERROR; |
| 109812 | } |
| 109813 | xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry); |
| 109814 | |
| 109815 | /* If no entry point was specified and the default legacy |
| 109816 | ** entry point name "sqlite3_extension_init" was not found, then |
| 109817 | ** construct an entry point name "sqlite3_X_init" where the X is |
| 109818 | ** replaced by the lowercase value of every ASCII alphabetic |
| @@ -109790,12 +109840,11 @@ | |
| 109840 | zAltEntry[iEntry++] = (char)sqlite3UpperToLower[(unsigned)c]; |
| 109841 | } |
| 109842 | } |
| 109843 | memcpy(zAltEntry+iEntry, "_init", 6); |
| 109844 | zEntry = zAltEntry; |
| 109845 | xInit = (sqlite3_loadext_entry)sqlite3OsDlSym(pVfs, handle, zEntry); |
| 109846 | } |
| 109847 | if( xInit==0 ){ |
| 109848 | if( pzErrMsg ){ |
| 109849 | nMsg += sqlite3Strlen30(zEntry); |
| 109850 | *pzErrMsg = zErrmsg = sqlite3_malloc64(nMsg); |
| @@ -109833,11 +109882,11 @@ | |
| 109882 | db->aExtension = aHandle; |
| 109883 | |
| 109884 | db->aExtension[db->nExtension++] = handle; |
| 109885 | return SQLITE_OK; |
| 109886 | } |
| 109887 | SQLITE_API int SQLITE_APICALL sqlite3_load_extension( |
| 109888 | sqlite3 *db, /* Load the extension into this database connection */ |
| 109889 | const char *zFile, /* Name of the shared library containing extension */ |
| 109890 | const char *zProc, /* Entry point. Use "sqlite3_extension_init" if 0 */ |
| 109891 | char **pzErrMsg /* Put error message here if not 0 */ |
| 109892 | ){ |
| @@ -109864,11 +109913,11 @@ | |
| 109913 | |
| 109914 | /* |
| 109915 | ** Enable or disable extension loading. Extension loading is disabled by |
| 109916 | ** default so as not to open security holes in older applications. |
| 109917 | */ |
| 109918 | SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff){ |
| 109919 | sqlite3_mutex_enter(db->mutex); |
| 109920 | if( onoff ){ |
| 109921 | db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc; |
| 109922 | }else{ |
| 109923 | db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc); |
| @@ -109921,11 +109970,13 @@ | |
| 109970 | |
| 109971 | /* |
| 109972 | ** Register a statically linked extension that is automatically |
| 109973 | ** loaded by every new database connection. |
| 109974 | */ |
| 109975 | SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( |
| 109976 | int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 109977 | ){ |
| 109978 | int rc = SQLITE_OK; |
| 109979 | #ifndef SQLITE_OMIT_AUTOINIT |
| 109980 | rc = sqlite3_initialize(); |
| 109981 | if( rc ){ |
| 109982 | return rc; |
| @@ -109937,21 +109988,21 @@ | |
| 109988 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 109989 | #endif |
| 109990 | wsdAutoextInit; |
| 109991 | sqlite3_mutex_enter(mutex); |
| 109992 | for(i=0; i<wsdAutoext.nExt; i++){ |
| 109993 | if( wsdAutoext.aExt[i]==(void*)xInit ) break; |
| 109994 | } |
| 109995 | if( i==wsdAutoext.nExt ){ |
| 109996 | u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]); |
| 109997 | void (**aNew)(void); |
| 109998 | aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte); |
| 109999 | if( aNew==0 ){ |
| 110000 | rc = SQLITE_NOMEM_BKPT; |
| 110001 | }else{ |
| 110002 | wsdAutoext.aExt = aNew; |
| 110003 | wsdAutoext.aExt[wsdAutoext.nExt] = (void*)xInit; |
| 110004 | wsdAutoext.nExt++; |
| 110005 | } |
| 110006 | } |
| 110007 | sqlite3_mutex_leave(mutex); |
| 110008 | assert( (rc&0xff)==rc ); |
| @@ -109966,20 +110017,22 @@ | |
| 110017 | ** routine is a no-op. |
| 110018 | ** |
| 110019 | ** Return 1 if xInit was found on the list and removed. Return 0 if xInit |
| 110020 | ** was not on the list. |
| 110021 | */ |
| 110022 | SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( |
| 110023 | int (*xInit)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 110024 | ){ |
| 110025 | #if SQLITE_THREADSAFE |
| 110026 | sqlite3_mutex *mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); |
| 110027 | #endif |
| 110028 | int i; |
| 110029 | int n = 0; |
| 110030 | wsdAutoextInit; |
| 110031 | sqlite3_mutex_enter(mutex); |
| 110032 | for(i=(int)wsdAutoext.nExt-1; i>=0; i--){ |
| 110033 | if( wsdAutoext.aExt[i]==(void*)xInit ){ |
| 110034 | wsdAutoext.nExt--; |
| 110035 | wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt]; |
| 110036 | n++; |
| 110037 | break; |
| 110038 | } |
| @@ -109989,11 +110042,11 @@ | |
| 110042 | } |
| 110043 | |
| 110044 | /* |
| 110045 | ** Reset the automatic extension loading mechanism. |
| 110046 | */ |
| 110047 | SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void){ |
| 110048 | #ifndef SQLITE_OMIT_AUTOINIT |
| 110049 | if( sqlite3_initialize()==SQLITE_OK ) |
| 110050 | #endif |
| 110051 | { |
| 110052 | #if SQLITE_THREADSAFE |
| @@ -110015,11 +110068,11 @@ | |
| 110068 | */ |
| 110069 | SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){ |
| 110070 | u32 i; |
| 110071 | int go = 1; |
| 110072 | int rc; |
| 110073 | sqlite3_loadext_entry xInit; |
| 110074 | |
| 110075 | wsdAutoextInit; |
| 110076 | if( wsdAutoext.nExt==0 ){ |
| 110077 | /* Common case: early out without every having to acquire a mutex */ |
| 110078 | return; |
| @@ -110032,12 +110085,11 @@ | |
| 110085 | sqlite3_mutex_enter(mutex); |
| 110086 | if( i>=wsdAutoext.nExt ){ |
| 110087 | xInit = 0; |
| 110088 | go = 0; |
| 110089 | }else{ |
| 110090 | xInit = (sqlite3_loadext_entry)wsdAutoext.aExt[i]; |
| 110091 | } |
| 110092 | sqlite3_mutex_leave(mutex); |
| 110093 | zErrmsg = 0; |
| 110094 | if( xInit && (rc = xInit(db, &zErrmsg, &sqlite3Apis))!=0 ){ |
| 110095 | sqlite3ErrorWithMsg(db, rc, |
| @@ -113251,11 +113303,11 @@ | |
| 113303 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 113304 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 113305 | ** and the statement is automatically recompiled if an schema change |
| 113306 | ** occurs. |
| 113307 | */ |
| 113308 | SQLITE_API int SQLITE_APICALL sqlite3_prepare( |
| 113309 | sqlite3 *db, /* Database handle. */ |
| 113310 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 113311 | int nBytes, /* Length of zSql in bytes. */ |
| 113312 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113313 | const char **pzTail /* OUT: End of parsed string */ |
| @@ -113263,11 +113315,11 @@ | |
| 113315 | int rc; |
| 113316 | rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail); |
| 113317 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 113318 | return rc; |
| 113319 | } |
| 113320 | SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2( |
| 113321 | sqlite3 *db, /* Database handle. */ |
| 113322 | const char *zSql, /* UTF-8 encoded SQL statement. */ |
| 113323 | int nBytes, /* Length of zSql in bytes. */ |
| 113324 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113325 | const char **pzTail /* OUT: End of parsed string */ |
| @@ -113339,11 +113391,11 @@ | |
| 113391 | ** and so if a schema change occurs, SQLITE_SCHEMA is returned by |
| 113392 | ** sqlite3_step(). In the new version, the original SQL text is retained |
| 113393 | ** and the statement is automatically recompiled if an schema change |
| 113394 | ** occurs. |
| 113395 | */ |
| 113396 | SQLITE_API int SQLITE_APICALL sqlite3_prepare16( |
| 113397 | sqlite3 *db, /* Database handle. */ |
| 113398 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 113399 | int nBytes, /* Length of zSql in bytes. */ |
| 113400 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113401 | const void **pzTail /* OUT: End of parsed string */ |
| @@ -113351,11 +113403,11 @@ | |
| 113403 | int rc; |
| 113404 | rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail); |
| 113405 | assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */ |
| 113406 | return rc; |
| 113407 | } |
| 113408 | SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2( |
| 113409 | sqlite3 *db, /* Database handle. */ |
| 113410 | const void *zSql, /* UTF-16 encoded SQL statement. */ |
| 113411 | int nBytes, /* Length of zSql in bytes. */ |
| 113412 | sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */ |
| 113413 | const void **pzTail /* OUT: End of parsed string */ |
| @@ -119194,11 +119246,11 @@ | |
| 119246 | ** The result that is written to ***pazResult is held in memory obtained |
| 119247 | ** from malloc(). But the caller cannot free this memory directly. |
| 119248 | ** Instead, the entire table should be passed to sqlite3_free_table() when |
| 119249 | ** the calling procedure is finished using it. |
| 119250 | */ |
| 119251 | SQLITE_API int SQLITE_APICALL sqlite3_get_table( |
| 119252 | sqlite3 *db, /* The database on which the SQL executes */ |
| 119253 | const char *zSql, /* The SQL to be executed */ |
| 119254 | char ***pazResult, /* Write the result table here */ |
| 119255 | int *pnRow, /* Write the number of rows in the result here */ |
| 119256 | int *pnColumn, /* Write the number of columns of result here */ |
| @@ -119263,11 +119315,11 @@ | |
| 119315 | } |
| 119316 | |
| 119317 | /* |
| 119318 | ** This routine frees the space the sqlite3_get_table() malloced. |
| 119319 | */ |
| 119320 | SQLITE_API void SQLITE_APICALL sqlite3_free_table( |
| 119321 | char **azResult /* Result returned from sqlite3_get_table() */ |
| 119322 | ){ |
| 119323 | if( azResult ){ |
| 119324 | int i, n; |
| 119325 | azResult--; |
| @@ -121673,11 +121725,11 @@ | |
| 121725 | |
| 121726 | |
| 121727 | /* |
| 121728 | ** External API function used to create a new virtual-table module. |
| 121729 | */ |
| 121730 | SQLITE_API int SQLITE_APICALL sqlite3_create_module( |
| 121731 | sqlite3 *db, /* Database in which module is registered */ |
| 121732 | const char *zName, /* Name assigned to this module */ |
| 121733 | const sqlite3_module *pModule, /* The definition of the module */ |
| 121734 | void *pAux /* Context pointer for xCreate/xConnect */ |
| 121735 | ){ |
| @@ -121688,11 +121740,11 @@ | |
| 121740 | } |
| 121741 | |
| 121742 | /* |
| 121743 | ** External API function used to create a new virtual-table module. |
| 121744 | */ |
| 121745 | SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2( |
| 121746 | sqlite3 *db, /* Database in which module is registered */ |
| 121747 | const char *zName, /* Name assigned to this module */ |
| 121748 | const sqlite3_module *pModule, /* The definition of the module */ |
| 121749 | void *pAux, /* Context pointer for xCreate/xConnect */ |
| 121750 | void (*xDestroy)(void *) /* Module destructor function */ |
| @@ -122312,11 +122364,11 @@ | |
| 122364 | /* |
| 122365 | ** This function is used to set the schema of a virtual table. It is only |
| 122366 | ** valid to call this function from within the xCreate() or xConnect() of a |
| 122367 | ** virtual table module. |
| 122368 | */ |
| 122369 | SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3 *db, const char *zCreateTable){ |
| 122370 | VtabCtx *pCtx; |
| 122371 | Parse *pParse; |
| 122372 | int rc = SQLITE_OK; |
| 122373 | Table *pTab; |
| 122374 | char *zErr = 0; |
| @@ -122766,11 +122818,11 @@ | |
| 122818 | ** table update operation currently in progress. |
| 122819 | ** |
| 122820 | ** The results of this routine are undefined unless it is called from |
| 122821 | ** within an xUpdate method. |
| 122822 | */ |
| 122823 | SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *db){ |
| 122824 | static const unsigned char aMap[] = { |
| 122825 | SQLITE_ROLLBACK, SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_REPLACE |
| 122826 | }; |
| 122827 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 122828 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| @@ -129063,15 +129115,15 @@ | |
| 129115 | LogEst nIter; |
| 129116 | pNew->u.btree.nEq++; |
| 129117 | pNew->nSkip++; |
| 129118 | pNew->aLTerm[pNew->nLTerm++] = 0; |
| 129119 | pNew->wsFlags |= WHERE_SKIPSCAN; |
| 129120 | nIter = pProbe->aiRowLogEst[saved_nEq] - pProbe->aiRowLogEst[saved_nEq+1]; |
| 129121 | pNew->nOut -= nIter; |
| 129122 | /* TUNING: Because uncertainties in the estimates for skip-scan queries, |
| 129123 | ** add a 1.375 fudge factor to make skip-scan slightly less likely. */ |
| 129124 | nIter += 5; |
| 129125 | whereLoopAddBtreeIndex(pBuilder, pSrc, pProbe, nIter + nInMul); |
| 129126 | pNew->nOut = saved_nOut; |
| 129127 | pNew->u.btree.nEq = saved_nEq; |
| 129128 | pNew->nSkip = saved_nSkip; |
| 129129 | pNew->wsFlags = saved_wsFlags; |
| @@ -136091,11 +136143,11 @@ | |
| 136143 | ** |
| 136144 | ** If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed |
| 136145 | ** to recognize the end of a trigger can be omitted. All we have to do |
| 136146 | ** is look for a semicolon that is not part of an string or comment. |
| 136147 | */ |
| 136148 | SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *zSql){ |
| 136149 | u8 state = 0; /* Current state, using numbers defined in header comment */ |
| 136150 | u8 token; /* Value of the next token */ |
| 136151 | |
| 136152 | #ifndef SQLITE_OMIT_TRIGGER |
| 136153 | /* A complex statement machine used to detect the end of a CREATE TRIGGER |
| @@ -136256,11 +136308,11 @@ | |
| 136308 | /* |
| 136309 | ** This routine is the same as the sqlite3_complete() routine described |
| 136310 | ** above, except that the parameter is required to be UTF-16 encoded, not |
| 136311 | ** UTF-8. |
| 136312 | */ |
| 136313 | SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *zSql){ |
| 136314 | sqlite3_value *pVal; |
| 136315 | char const *zSql8; |
| 136316 | int rc; |
| 136317 | |
| 136318 | #ifndef SQLITE_OMIT_AUTOINIT |
| @@ -136416,28 +136468,28 @@ | |
| 136468 | #endif |
| 136469 | |
| 136470 | /* IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns |
| 136471 | ** a pointer to the to the sqlite3_version[] string constant. |
| 136472 | */ |
| 136473 | SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void){ return sqlite3_version; } |
| 136474 | |
| 136475 | /* IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a |
| 136476 | ** pointer to a string constant whose value is the same as the |
| 136477 | ** SQLITE_SOURCE_ID C preprocessor macro. |
| 136478 | */ |
| 136479 | SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 136480 | |
| 136481 | /* IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function |
| 136482 | ** returns an integer equal to SQLITE_VERSION_NUMBER. |
| 136483 | */ |
| 136484 | SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } |
| 136485 | |
| 136486 | /* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns |
| 136487 | ** zero if and only if SQLite was compiled with mutexing code omitted due to |
| 136488 | ** the SQLITE_THREADSAFE compile-time option being set to 0. |
| 136489 | */ |
| 136490 | SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } |
| 136491 | |
| 136492 | /* |
| 136493 | ** When compiling the test fixture or with debugging enabled (on Win32), |
| 136494 | ** this variable being set to non-zero will cause OSTRACE macros to emit |
| 136495 | ** extra diagnostic information. |
| @@ -136506,11 +136558,11 @@ | |
| 136558 | ** call by X completes. |
| 136559 | ** |
| 136560 | ** * Recursive calls to this routine from thread X return immediately |
| 136561 | ** without blocking. |
| 136562 | */ |
| 136563 | SQLITE_API int SQLITE_APICALL sqlite3_initialize(void){ |
| 136564 | MUTEX_LOGIC( sqlite3_mutex *pMaster; ) /* The main static mutex */ |
| 136565 | int rc; /* Result code */ |
| 136566 | #ifdef SQLITE_EXTRA_INIT |
| 136567 | int bRunExtraInit = 0; /* Extra initialization needed */ |
| 136568 | #endif |
| @@ -136672,11 +136724,11 @@ | |
| 136724 | ** while any part of SQLite is otherwise in use in any thread. This |
| 136725 | ** routine is not threadsafe. But it is safe to invoke this routine |
| 136726 | ** on when SQLite is already shut down. If SQLite is already shut down |
| 136727 | ** when this routine is invoked, then this routine is a harmless no-op. |
| 136728 | */ |
| 136729 | SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void){ |
| 136730 | #ifdef SQLITE_OMIT_WSD |
| 136731 | int rc = sqlite3_wsd_init(4096, 24); |
| 136732 | if( rc!=SQLITE_OK ){ |
| 136733 | return rc; |
| 136734 | } |
| @@ -137091,11 +137143,11 @@ | |
| 137143 | } |
| 137144 | |
| 137145 | /* |
| 137146 | ** Return the mutex associated with a database connection. |
| 137147 | */ |
| 137148 | SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3 *db){ |
| 137149 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137150 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137151 | (void)SQLITE_MISUSE_BKPT; |
| 137152 | return 0; |
| 137153 | } |
| @@ -137105,11 +137157,11 @@ | |
| 137157 | |
| 137158 | /* |
| 137159 | ** Free up as much memory as we can from the given database |
| 137160 | ** connection. |
| 137161 | */ |
| 137162 | SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3 *db){ |
| 137163 | int i; |
| 137164 | |
| 137165 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137166 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 137167 | #endif |
| @@ -137129,11 +137181,11 @@ | |
| 137181 | |
| 137182 | /* |
| 137183 | ** Flush any dirty pages in the pager-cache for any attached database |
| 137184 | ** to disk. |
| 137185 | */ |
| 137186 | SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3 *db){ |
| 137187 | int i; |
| 137188 | int rc = SQLITE_OK; |
| 137189 | int bSeenBusy = 0; |
| 137190 | |
| 137191 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -137279,11 +137331,11 @@ | |
| 137331 | } |
| 137332 | |
| 137333 | /* |
| 137334 | ** Return the ROWID of the most recent insert |
| 137335 | */ |
| 137336 | SQLITE_API sqlite_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3 *db){ |
| 137337 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137338 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137339 | (void)SQLITE_MISUSE_BKPT; |
| 137340 | return 0; |
| 137341 | } |
| @@ -137292,11 +137344,11 @@ | |
| 137344 | } |
| 137345 | |
| 137346 | /* |
| 137347 | ** Return the number of changes in the most recent call to sqlite3_exec(). |
| 137348 | */ |
| 137349 | SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3 *db){ |
| 137350 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137351 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137352 | (void)SQLITE_MISUSE_BKPT; |
| 137353 | return 0; |
| 137354 | } |
| @@ -137305,11 +137357,11 @@ | |
| 137357 | } |
| 137358 | |
| 137359 | /* |
| 137360 | ** Return the number of changes since the database handle was opened. |
| 137361 | */ |
| 137362 | SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3 *db){ |
| 137363 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137364 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137365 | (void)SQLITE_MISUSE_BKPT; |
| 137366 | return 0; |
| 137367 | } |
| @@ -137456,12 +137508,12 @@ | |
| 137508 | ** statements or unfinished sqlite3_backups. The sqlite3_close_v2() |
| 137509 | ** version forces the connection to become a zombie if there are |
| 137510 | ** unclosed resources, and arranges for deallocation when the last |
| 137511 | ** prepare statement or sqlite3_backup closes. |
| 137512 | */ |
| 137513 | SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3 *db){ return sqlite3Close(db,0); } |
| 137514 | SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3 *db){ return sqlite3Close(db,1); } |
| 137515 | |
| 137516 | |
| 137517 | /* |
| 137518 | ** Close the mutex on database connection db. |
| 137519 | ** |
| @@ -137864,11 +137916,11 @@ | |
| 137916 | |
| 137917 | /* |
| 137918 | ** This routine sets the busy callback for an Sqlite database to the |
| 137919 | ** given callback function with the given argument. |
| 137920 | */ |
| 137921 | SQLITE_API int SQLITE_APICALL sqlite3_busy_handler( |
| 137922 | sqlite3 *db, |
| 137923 | int (*xBusy)(void*,int), |
| 137924 | void *pArg |
| 137925 | ){ |
| 137926 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -137887,11 +137939,11 @@ | |
| 137939 | /* |
| 137940 | ** This routine sets the progress callback for an Sqlite database to the |
| 137941 | ** given callback function with the given argument. The progress callback will |
| 137942 | ** be invoked every nOps opcodes. |
| 137943 | */ |
| 137944 | SQLITE_API void SQLITE_APICALL sqlite3_progress_handler( |
| 137945 | sqlite3 *db, |
| 137946 | int nOps, |
| 137947 | int (*xProgress)(void*), |
| 137948 | void *pArg |
| 137949 | ){ |
| @@ -137918,11 +137970,11 @@ | |
| 137970 | |
| 137971 | /* |
| 137972 | ** This routine installs a default busy handler that waits for the |
| 137973 | ** specified number of milliseconds before returning 0. |
| 137974 | */ |
| 137975 | SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3 *db, int ms){ |
| 137976 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137977 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 137978 | #endif |
| 137979 | if( ms>0 ){ |
| 137980 | sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); |
| @@ -137934,11 +137986,11 @@ | |
| 137986 | } |
| 137987 | |
| 137988 | /* |
| 137989 | ** Cause any pending operation to stop at its earliest opportunity. |
| 137990 | */ |
| 137991 | SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3 *db){ |
| 137992 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 137993 | if( !sqlite3SafetyCheckOk(db) ){ |
| 137994 | (void)SQLITE_MISUSE_BKPT; |
| 137995 | return; |
| 137996 | } |
| @@ -138050,11 +138102,11 @@ | |
| 138102 | } |
| 138103 | |
| 138104 | /* |
| 138105 | ** Create new user functions. |
| 138106 | */ |
| 138107 | SQLITE_API int SQLITE_APICALL sqlite3_create_function( |
| 138108 | sqlite3 *db, |
| 138109 | const char *zFunc, |
| 138110 | int nArg, |
| 138111 | int enc, |
| 138112 | void *p, |
| @@ -138064,11 +138116,11 @@ | |
| 138116 | ){ |
| 138117 | return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep, |
| 138118 | xFinal, 0); |
| 138119 | } |
| 138120 | |
| 138121 | SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2( |
| 138122 | sqlite3 *db, |
| 138123 | const char *zFunc, |
| 138124 | int nArg, |
| 138125 | int enc, |
| 138126 | void *p, |
| @@ -138107,11 +138159,11 @@ | |
| 138159 | sqlite3_mutex_leave(db->mutex); |
| 138160 | return rc; |
| 138161 | } |
| 138162 | |
| 138163 | #ifndef SQLITE_OMIT_UTF16 |
| 138164 | SQLITE_API int SQLITE_APICALL sqlite3_create_function16( |
| 138165 | sqlite3 *db, |
| 138166 | const void *zFunctionName, |
| 138167 | int nArg, |
| 138168 | int eTextRep, |
| 138169 | void *p, |
| @@ -138147,11 +138199,11 @@ | |
| 138199 | ** When virtual tables intend to provide an overloaded function, they |
| 138200 | ** should call this routine to make sure the global function exists. |
| 138201 | ** A global function must exist in order for name resolution to work |
| 138202 | ** properly. |
| 138203 | */ |
| 138204 | SQLITE_API int SQLITE_APICALL sqlite3_overload_function( |
| 138205 | sqlite3 *db, |
| 138206 | const char *zName, |
| 138207 | int nArg |
| 138208 | ){ |
| 138209 | int rc = SQLITE_OK; |
| @@ -138179,11 +138231,11 @@ | |
| 138231 | ** A NULL trace function means that no tracing is executes. A non-NULL |
| 138232 | ** trace is a pointer to a function that is invoked at the start of each |
| 138233 | ** SQL statement. |
| 138234 | */ |
| 138235 | #ifndef SQLITE_OMIT_DEPRECATED |
| 138236 | SQLITE_API void *SQLITE_APICALL sqlite3_trace(sqlite3 *db, void(*xTrace)(void*,const char*), void *pArg){ |
| 138237 | void *pOld; |
| 138238 | |
| 138239 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138240 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138241 | (void)SQLITE_MISUSE_BKPT; |
| @@ -138200,11 +138252,11 @@ | |
| 138252 | } |
| 138253 | #endif /* SQLITE_OMIT_DEPRECATED */ |
| 138254 | |
| 138255 | /* Register a trace callback using the version-2 interface. |
| 138256 | */ |
| 138257 | SQLITE_API int SQLITE_APICALL sqlite3_trace_v2( |
| 138258 | sqlite3 *db, /* Trace this connection */ |
| 138259 | unsigned mTrace, /* Mask of events to be traced */ |
| 138260 | int(*xTrace)(unsigned,void*,void*,void*), /* Callback to invoke */ |
| 138261 | void *pArg /* Context */ |
| 138262 | ){ |
| @@ -138228,11 +138280,11 @@ | |
| 138280 | ** |
| 138281 | ** A NULL profile function means that no profiling is executes. A non-NULL |
| 138282 | ** profile is a pointer to a function that is invoked at the conclusion of |
| 138283 | ** each SQL statement that is run. |
| 138284 | */ |
| 138285 | SQLITE_API void *SQLITE_APICALL sqlite3_profile( |
| 138286 | sqlite3 *db, |
| 138287 | void (*xProfile)(void*,const char*,sqlite_uint64), |
| 138288 | void *pArg |
| 138289 | ){ |
| 138290 | void *pOld; |
| @@ -138256,11 +138308,11 @@ | |
| 138308 | /* |
| 138309 | ** Register a function to be invoked when a transaction commits. |
| 138310 | ** If the invoked function returns non-zero, then the commit becomes a |
| 138311 | ** rollback. |
| 138312 | */ |
| 138313 | SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook( |
| 138314 | sqlite3 *db, /* Attach the hook to this database */ |
| 138315 | int (*xCallback)(void*), /* Function to invoke on each commit */ |
| 138316 | void *pArg /* Argument to the function */ |
| 138317 | ){ |
| 138318 | void *pOld; |
| @@ -138281,11 +138333,11 @@ | |
| 138333 | |
| 138334 | /* |
| 138335 | ** Register a callback to be invoked each time a row is updated, |
| 138336 | ** inserted or deleted using this database connection. |
| 138337 | */ |
| 138338 | SQLITE_API void *SQLITE_APICALL sqlite3_update_hook( |
| 138339 | sqlite3 *db, /* Attach the hook to this database */ |
| 138340 | void (*xCallback)(void*,int,char const *,char const *,sqlite_int64), |
| 138341 | void *pArg /* Argument to the function */ |
| 138342 | ){ |
| 138343 | void *pRet; |
| @@ -138306,11 +138358,11 @@ | |
| 138358 | |
| 138359 | /* |
| 138360 | ** Register a callback to be invoked each time a transaction is rolled |
| 138361 | ** back by this database connection. |
| 138362 | */ |
| 138363 | SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook( |
| 138364 | sqlite3 *db, /* Attach the hook to this database */ |
| 138365 | void (*xCallback)(void*), /* Callback function */ |
| 138366 | void *pArg /* Argument to the function */ |
| 138367 | ){ |
| 138368 | void *pRet; |
| @@ -138332,11 +138384,11 @@ | |
| 138384 | #ifdef SQLITE_ENABLE_PREUPDATE_HOOK |
| 138385 | /* |
| 138386 | ** Register a callback to be invoked each time a row is updated, |
| 138387 | ** inserted or deleted using this database connection. |
| 138388 | */ |
| 138389 | SQLITE_API void *SQLITE_APICALL sqlite3_preupdate_hook( |
| 138390 | sqlite3 *db, /* Attach the hook to this database */ |
| 138391 | void(*xCallback)( /* Callback function */ |
| 138392 | void*,sqlite3*,int,char const*,char const*,sqlite3_int64,sqlite3_int64), |
| 138393 | void *pArg /* First callback argument */ |
| 138394 | ){ |
| @@ -138381,11 +138433,11 @@ | |
| 138433 | ** The callback registered by this function replaces any existing callback |
| 138434 | ** registered using sqlite3_wal_hook(). Likewise, registering a callback |
| 138435 | ** using sqlite3_wal_hook() disables the automatic checkpoint mechanism |
| 138436 | ** configured by this function. |
| 138437 | */ |
| 138438 | SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int nFrame){ |
| 138439 | #ifdef SQLITE_OMIT_WAL |
| 138440 | UNUSED_PARAMETER(db); |
| 138441 | UNUSED_PARAMETER(nFrame); |
| 138442 | #else |
| 138443 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -138402,11 +138454,11 @@ | |
| 138454 | |
| 138455 | /* |
| 138456 | ** Register a callback to be invoked each time a transaction is written |
| 138457 | ** into the write-ahead-log by this database connection. |
| 138458 | */ |
| 138459 | SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook( |
| 138460 | sqlite3 *db, /* Attach the hook to this db handle */ |
| 138461 | int(*xCallback)(void *, sqlite3*, const char*, int), |
| 138462 | void *pArg /* First argument passed to xCallback() */ |
| 138463 | ){ |
| 138464 | #ifndef SQLITE_OMIT_WAL |
| @@ -138429,11 +138481,11 @@ | |
| 138481 | } |
| 138482 | |
| 138483 | /* |
| 138484 | ** Checkpoint database zDb. |
| 138485 | */ |
| 138486 | SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2( |
| 138487 | sqlite3 *db, /* Database handle */ |
| 138488 | const char *zDb, /* Name of attached database (or NULL) */ |
| 138489 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 138490 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 138491 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -138484,11 +138536,11 @@ | |
| 138536 | /* |
| 138537 | ** Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points |
| 138538 | ** to contains a zero-length string, all attached databases are |
| 138539 | ** checkpointed. |
| 138540 | */ |
| 138541 | SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){ |
| 138542 | /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to |
| 138543 | ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */ |
| 138544 | return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0); |
| 138545 | } |
| 138546 | |
| @@ -138575,11 +138627,11 @@ | |
| 138627 | |
| 138628 | /* |
| 138629 | ** Return UTF-8 encoded English language explanation of the most recent |
| 138630 | ** error. |
| 138631 | */ |
| 138632 | SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3 *db){ |
| 138633 | const char *z; |
| 138634 | if( !db ){ |
| 138635 | return sqlite3ErrStr(SQLITE_NOMEM_BKPT); |
| 138636 | } |
| 138637 | if( !sqlite3SafetyCheckSickOrOk(db) ){ |
| @@ -138603,11 +138655,11 @@ | |
| 138655 | #ifndef SQLITE_OMIT_UTF16 |
| 138656 | /* |
| 138657 | ** Return UTF-16 encoded English language explanation of the most recent |
| 138658 | ** error. |
| 138659 | */ |
| 138660 | SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3 *db){ |
| 138661 | static const u16 outOfMem[] = { |
| 138662 | 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 |
| 138663 | }; |
| 138664 | static const u16 misuse[] = { |
| 138665 | 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', |
| @@ -138648,38 +138700,38 @@ | |
| 138700 | |
| 138701 | /* |
| 138702 | ** Return the most recent error code generated by an SQLite routine. If NULL is |
| 138703 | ** passed to this function, we assume a malloc() failed during sqlite3_open(). |
| 138704 | */ |
| 138705 | SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db){ |
| 138706 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 138707 | return SQLITE_MISUSE_BKPT; |
| 138708 | } |
| 138709 | if( !db || db->mallocFailed ){ |
| 138710 | return SQLITE_NOMEM_BKPT; |
| 138711 | } |
| 138712 | return db->errCode & db->errMask; |
| 138713 | } |
| 138714 | SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db){ |
| 138715 | if( db && !sqlite3SafetyCheckSickOrOk(db) ){ |
| 138716 | return SQLITE_MISUSE_BKPT; |
| 138717 | } |
| 138718 | if( !db || db->mallocFailed ){ |
| 138719 | return SQLITE_NOMEM_BKPT; |
| 138720 | } |
| 138721 | return db->errCode; |
| 138722 | } |
| 138723 | SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3 *db){ |
| 138724 | return db ? db->iSysErrno : 0; |
| 138725 | } |
| 138726 | |
| 138727 | /* |
| 138728 | ** Return a string that describes the kind of error specified in the |
| 138729 | ** argument. For now, this simply calls the internal sqlite3ErrStr() |
| 138730 | ** function. |
| 138731 | */ |
| 138732 | SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int rc){ |
| 138733 | return sqlite3ErrStr(rc); |
| 138734 | } |
| 138735 | |
| 138736 | /* |
| 138737 | ** Create a new collating function for database "db". The name is zName |
| @@ -138823,11 +138875,11 @@ | |
| 138875 | ** |
| 138876 | ** A new lower limit does not shrink existing constructs. |
| 138877 | ** It merely prevents new constructs that exceed the limit |
| 138878 | ** from forming. |
| 138879 | */ |
| 138880 | SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ |
| 138881 | int oldLimit; |
| 138882 | |
| 138883 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 138884 | if( !sqlite3SafetyCheckOk(db) ){ |
| 138885 | (void)SQLITE_MISUSE_BKPT; |
| @@ -139447,18 +139499,18 @@ | |
| 139499 | } |
| 139500 | |
| 139501 | /* |
| 139502 | ** Open a new database handle. |
| 139503 | */ |
| 139504 | SQLITE_API int SQLITE_APICALL sqlite3_open( |
| 139505 | const char *zFilename, |
| 139506 | sqlite3 **ppDb |
| 139507 | ){ |
| 139508 | return openDatabase(zFilename, ppDb, |
| 139509 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); |
| 139510 | } |
| 139511 | SQLITE_API int SQLITE_APICALL sqlite3_open_v2( |
| 139512 | const char *filename, /* Database filename (UTF-8) */ |
| 139513 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 139514 | int flags, /* Flags */ |
| 139515 | const char *zVfs /* Name of VFS module to use */ |
| 139516 | ){ |
| @@ -139467,11 +139519,11 @@ | |
| 139519 | |
| 139520 | #ifndef SQLITE_OMIT_UTF16 |
| 139521 | /* |
| 139522 | ** Open a new database handle. |
| 139523 | */ |
| 139524 | SQLITE_API int SQLITE_APICALL sqlite3_open16( |
| 139525 | const void *zFilename, |
| 139526 | sqlite3 **ppDb |
| 139527 | ){ |
| 139528 | char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ |
| 139529 | sqlite3_value *pVal; |
| @@ -139506,11 +139558,11 @@ | |
| 139558 | #endif /* SQLITE_OMIT_UTF16 */ |
| 139559 | |
| 139560 | /* |
| 139561 | ** Register a new collation sequence with the database handle db. |
| 139562 | */ |
| 139563 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation( |
| 139564 | sqlite3* db, |
| 139565 | const char *zName, |
| 139566 | int enc, |
| 139567 | void* pCtx, |
| 139568 | int(*xCompare)(void*,int,const void*,int,const void*) |
| @@ -139519,11 +139571,11 @@ | |
| 139571 | } |
| 139572 | |
| 139573 | /* |
| 139574 | ** Register a new collation sequence with the database handle db. |
| 139575 | */ |
| 139576 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2( |
| 139577 | sqlite3* db, |
| 139578 | const char *zName, |
| 139579 | int enc, |
| 139580 | void* pCtx, |
| 139581 | int(*xCompare)(void*,int,const void*,int,const void*), |
| @@ -139544,11 +139596,11 @@ | |
| 139596 | |
| 139597 | #ifndef SQLITE_OMIT_UTF16 |
| 139598 | /* |
| 139599 | ** Register a new collation sequence with the database handle db. |
| 139600 | */ |
| 139601 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation16( |
| 139602 | sqlite3* db, |
| 139603 | const void *zName, |
| 139604 | int enc, |
| 139605 | void* pCtx, |
| 139606 | int(*xCompare)(void*,int,const void*,int,const void*) |
| @@ -139574,11 +139626,11 @@ | |
| 139626 | |
| 139627 | /* |
| 139628 | ** Register a collation sequence factory callback with the database handle |
| 139629 | ** db. Replace any previously installed collation sequence factory. |
| 139630 | */ |
| 139631 | SQLITE_API int SQLITE_APICALL sqlite3_collation_needed( |
| 139632 | sqlite3 *db, |
| 139633 | void *pCollNeededArg, |
| 139634 | void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) |
| 139635 | ){ |
| 139636 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -139595,11 +139647,11 @@ | |
| 139647 | #ifndef SQLITE_OMIT_UTF16 |
| 139648 | /* |
| 139649 | ** Register a collation sequence factory callback with the database handle |
| 139650 | ** db. Replace any previously installed collation sequence factory. |
| 139651 | */ |
| 139652 | SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16( |
| 139653 | sqlite3 *db, |
| 139654 | void *pCollNeededArg, |
| 139655 | void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) |
| 139656 | ){ |
| 139657 | #ifdef SQLITE_ENABLE_API_ARMOR |
| @@ -139617,11 +139669,11 @@ | |
| 139669 | #ifndef SQLITE_OMIT_DEPRECATED |
| 139670 | /* |
| 139671 | ** This function is now an anachronism. It used to be used to recover from a |
| 139672 | ** malloc() failure, but SQLite now does this automatically. |
| 139673 | */ |
| 139674 | SQLITE_API int SQLITE_APICALL sqlite3_global_recover(void){ |
| 139675 | return SQLITE_OK; |
| 139676 | } |
| 139677 | #endif |
| 139678 | |
| 139679 | /* |
| @@ -139628,11 +139680,11 @@ | |
| 139680 | ** Test to see whether or not the database connection is in autocommit |
| 139681 | ** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on |
| 139682 | ** by default. Autocommit is disabled by a BEGIN statement and reenabled |
| 139683 | ** by the next COMMIT or ROLLBACK. |
| 139684 | */ |
| 139685 | SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3 *db){ |
| 139686 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139687 | if( !sqlite3SafetyCheckOk(db) ){ |
| 139688 | (void)SQLITE_MISUSE_BKPT; |
| 139689 | return 0; |
| 139690 | } |
| @@ -139685,19 +139737,19 @@ | |
| 139737 | ** data for this thread has been deallocated. |
| 139738 | ** |
| 139739 | ** SQLite no longer uses thread-specific data so this routine is now a |
| 139740 | ** no-op. It is retained for historical compatibility. |
| 139741 | */ |
| 139742 | SQLITE_API void SQLITE_APICALL sqlite3_thread_cleanup(void){ |
| 139743 | } |
| 139744 | #endif |
| 139745 | |
| 139746 | /* |
| 139747 | ** Return meta information about a specific column of a database table. |
| 139748 | ** See comment in sqlite3.h (sqlite.h.in) for details. |
| 139749 | */ |
| 139750 | SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata( |
| 139751 | sqlite3 *db, /* Connection handle */ |
| 139752 | const char *zDbName, /* Database name or NULL */ |
| 139753 | const char *zTableName, /* Table name */ |
| 139754 | const char *zColumnName, /* Column name */ |
| 139755 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -139811,11 +139863,11 @@ | |
| 139863 | } |
| 139864 | |
| 139865 | /* |
| 139866 | ** Sleep for a little while. Return the amount of time slept. |
| 139867 | */ |
| 139868 | SQLITE_API int SQLITE_APICALL sqlite3_sleep(int ms){ |
| 139869 | sqlite3_vfs *pVfs; |
| 139870 | int rc; |
| 139871 | pVfs = sqlite3_vfs_find(0); |
| 139872 | if( pVfs==0 ) return 0; |
| 139873 | |
| @@ -139827,11 +139879,11 @@ | |
| 139879 | } |
| 139880 | |
| 139881 | /* |
| 139882 | ** Enable or disable the extended result codes. |
| 139883 | */ |
| 139884 | SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3 *db, int onoff){ |
| 139885 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139886 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| 139887 | #endif |
| 139888 | sqlite3_mutex_enter(db->mutex); |
| 139889 | db->errMask = onoff ? 0xffffffff : 0xff; |
| @@ -139840,11 +139892,11 @@ | |
| 139892 | } |
| 139893 | |
| 139894 | /* |
| 139895 | ** Invoke the xFileControl method on a particular database. |
| 139896 | */ |
| 139897 | SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ |
| 139898 | int rc = SQLITE_ERROR; |
| 139899 | Btree *pBtree; |
| 139900 | |
| 139901 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 139902 | if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; |
| @@ -140225,11 +140277,11 @@ | |
| 140277 | ** method of a VFS implementation. The zParam argument is the name of the |
| 140278 | ** query parameter we seek. This routine returns the value of the zParam |
| 140279 | ** parameter if it exists. If the parameter does not exist, this routine |
| 140280 | ** returns a NULL pointer. |
| 140281 | */ |
| 140282 | SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 140283 | if( zFilename==0 || zParam==0 ) return 0; |
| 140284 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 140285 | while( zFilename[0] ){ |
| 140286 | int x = strcmp(zFilename, zParam); |
| 140287 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| @@ -140240,20 +140292,20 @@ | |
| 140292 | } |
| 140293 | |
| 140294 | /* |
| 140295 | ** Return a boolean value for a query parameter. |
| 140296 | */ |
| 140297 | SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFilename, const char *zParam, int bDflt){ |
| 140298 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| 140299 | bDflt = bDflt!=0; |
| 140300 | return z ? sqlite3GetBoolean(z, bDflt) : bDflt; |
| 140301 | } |
| 140302 | |
| 140303 | /* |
| 140304 | ** Return a 64-bit integer value for a query parameter. |
| 140305 | */ |
| 140306 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64( |
| 140307 | const char *zFilename, /* Filename as passed to xOpen */ |
| 140308 | const char *zParam, /* URI parameter sought */ |
| 140309 | sqlite3_int64 bDflt /* return if parameter is missing */ |
| 140310 | ){ |
| 140311 | const char *z = sqlite3_uri_parameter(zFilename, zParam); |
| @@ -140281,11 +140333,11 @@ | |
| 140333 | |
| 140334 | /* |
| 140335 | ** Return the filename of the database associated with a database |
| 140336 | ** connection. |
| 140337 | */ |
| 140338 | SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName){ |
| 140339 | Btree *pBt; |
| 140340 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140341 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140342 | (void)SQLITE_MISUSE_BKPT; |
| 140343 | return 0; |
| @@ -140297,11 +140349,11 @@ | |
| 140349 | |
| 140350 | /* |
| 140351 | ** Return 1 if database is read-only or 0 if read/write. Return -1 if |
| 140352 | ** no such database exists. |
| 140353 | */ |
| 140354 | SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName){ |
| 140355 | Btree *pBt; |
| 140356 | #ifdef SQLITE_ENABLE_API_ARMOR |
| 140357 | if( !sqlite3SafetyCheckOk(db) ){ |
| 140358 | (void)SQLITE_MISUSE_BKPT; |
| 140359 | return -1; |
| @@ -140314,11 +140366,11 @@ | |
| 140366 | #ifdef SQLITE_ENABLE_SNAPSHOT |
| 140367 | /* |
| 140368 | ** Obtain a snapshot handle for the snapshot of database zDb currently |
| 140369 | ** being read by handle db. |
| 140370 | */ |
| 140371 | SQLITE_API int SQLITE_APICALL sqlite3_snapshot_get( |
| 140372 | sqlite3 *db, |
| 140373 | const char *zDb, |
| 140374 | sqlite3_snapshot **ppSnapshot |
| 140375 | ){ |
| 140376 | int rc = SQLITE_ERROR; |
| @@ -140349,11 +140401,11 @@ | |
| 140401 | } |
| 140402 | |
| 140403 | /* |
| 140404 | ** Open a read-transaction on the snapshot idendified by pSnapshot. |
| 140405 | */ |
| 140406 | SQLITE_API int SQLITE_APICALL sqlite3_snapshot_open( |
| 140407 | sqlite3 *db, |
| 140408 | const char *zDb, |
| 140409 | sqlite3_snapshot *pSnapshot |
| 140410 | ){ |
| 140411 | int rc = SQLITE_ERROR; |
| @@ -140386,11 +140438,11 @@ | |
| 140438 | } |
| 140439 | |
| 140440 | /* |
| 140441 | ** Free a snapshot handle obtained from sqlite3_snapshot_get(). |
| 140442 | */ |
| 140443 | SQLITE_API void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot *pSnapshot){ |
| 140444 | sqlite3_free(pSnapshot); |
| 140445 | } |
| 140446 | #endif /* SQLITE_ENABLE_SNAPSHOT */ |
| 140447 | |
| 140448 | /************** End of main.c ************************************************/ |
| @@ -140540,11 +140592,11 @@ | |
| 140592 | ** |
| 140593 | ** Each call to this routine overrides any prior callbacks registered |
| 140594 | ** on the same "db". If xNotify==0 then any prior callbacks are immediately |
| 140595 | ** cancelled. |
| 140596 | */ |
| 140597 | SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify( |
| 140598 | sqlite3 *db, |
| 140599 | void (*xNotify)(void **, int), |
| 140600 | void *pArg |
| 140601 | ){ |
| 140602 | int rc = SQLITE_OK; |
| @@ -147543,11 +147595,11 @@ | |
| 147595 | ** Initialize API pointer table, if required. |
| 147596 | */ |
| 147597 | #ifdef _WIN32 |
| 147598 | __declspec(dllexport) |
| 147599 | #endif |
| 147600 | SQLITE_API int SQLITE_APICALL sqlite3_fts3_init( |
| 147601 | sqlite3 *db, |
| 147602 | char **pzErrMsg, |
| 147603 | const sqlite3_api_routines *pApi |
| 147604 | ){ |
| 147605 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -150699,11 +150751,15 @@ | |
| 150751 | } |
| 150752 | |
| 150753 | |
| 150754 | #ifdef SQLITE_TEST |
| 150755 | |
| 150756 | #if defined(INCLUDE_SQLITE_TCL_H) |
| 150757 | # include "sqlite_tcl.h" |
| 150758 | #else |
| 150759 | # include "tcl.h" |
| 150760 | #endif |
| 150761 | /* #include <string.h> */ |
| 150762 | |
| 150763 | /* |
| 150764 | ** Implementation of a special SQL scalar function for testing tokenizers |
| 150765 | ** designed to be used in concert with the Tcl testing framework. This |
| @@ -163340,11 +163396,11 @@ | |
| 163396 | } |
| 163397 | |
| 163398 | /* |
| 163399 | ** Register a new geometry function for use with the r-tree MATCH operator. |
| 163400 | */ |
| 163401 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback( |
| 163402 | sqlite3 *db, /* Register SQL function on this connection */ |
| 163403 | const char *zGeom, /* Name of the new SQL function */ |
| 163404 | int (*xGeom)(sqlite3_rtree_geometry*,int,RtreeDValue*,int*), /* Callback */ |
| 163405 | void *pContext /* Extra data associated with the callback */ |
| 163406 | ){ |
| @@ -163364,11 +163420,11 @@ | |
| 163420 | |
| 163421 | /* |
| 163422 | ** Register a new 2nd-generation geometry function for use with the |
| 163423 | ** r-tree MATCH operator. |
| 163424 | */ |
| 163425 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback( |
| 163426 | sqlite3 *db, /* Register SQL function on this connection */ |
| 163427 | const char *zQueryFunc, /* Name of new SQL function */ |
| 163428 | int (*xQueryFunc)(sqlite3_rtree_query_info*), /* Callback */ |
| 163429 | void *pContext, /* Extra data passed into the callback */ |
| 163430 | void (*xDestructor)(void*) /* Destructor for the extra data */ |
| @@ -163389,11 +163445,11 @@ | |
| 163445 | |
| 163446 | #if !SQLITE_CORE |
| 163447 | #ifdef _WIN32 |
| 163448 | __declspec(dllexport) |
| 163449 | #endif |
| 163450 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_init( |
| 163451 | sqlite3 *db, |
| 163452 | char **pzErrMsg, |
| 163453 | const sqlite3_api_routines *pApi |
| 163454 | ){ |
| 163455 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -163940,11 +163996,11 @@ | |
| 163996 | |
| 163997 | #if !SQLITE_CORE |
| 163998 | #ifdef _WIN32 |
| 163999 | __declspec(dllexport) |
| 164000 | #endif |
| 164001 | SQLITE_API int SQLITE_APICALL sqlite3_icu_init( |
| 164002 | sqlite3 *db, |
| 164003 | char **pzErrMsg, |
| 164004 | const sqlite3_api_routines *pApi |
| 164005 | ){ |
| 164006 | SQLITE_EXTENSION_INIT2(pApi) |
| @@ -164620,11 +164676,11 @@ | |
| 164676 | ** IMPORTANT NOTE FOR ZIPVFS USERS: The RBU extension works with all of |
| 164677 | ** SQLite's built-in VFSs, including the multiplexor VFS. However it does |
| 164678 | ** not work out of the box with zipvfs. Refer to the comment describing |
| 164679 | ** the zipvfs_create_vfs() API below for details on using RBU with zipvfs. |
| 164680 | */ |
| 164681 | SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open( |
| 164682 | const char *zTarget, |
| 164683 | const char *zRbu, |
| 164684 | const char *zState |
| 164685 | ); |
| 164686 | |
| @@ -164653,11 +164709,11 @@ | |
| 164709 | ** As with sqlite3rbu_open(), Zipvfs users should rever to the comment |
| 164710 | ** describing the sqlite3rbu_create_vfs() API function below for |
| 164711 | ** a description of the complications associated with using RBU with |
| 164712 | ** zipvfs databases. |
| 164713 | */ |
| 164714 | SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum( |
| 164715 | const char *zTarget, |
| 164716 | const char *zState |
| 164717 | ); |
| 164718 | |
| 164719 | /* |
| @@ -164689,11 +164745,11 @@ | |
| 164745 | ** when sqlite3rbu_close() is called. |
| 164746 | ** |
| 164747 | ** Database handles returned by this function remain valid until the next |
| 164748 | ** call to any sqlite3rbu_xxx() function other than sqlite3rbu_db(). |
| 164749 | */ |
| 164750 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu*, int bRbu); |
| 164751 | |
| 164752 | /* |
| 164753 | ** Do some work towards applying the RBU update to the target db. |
| 164754 | ** |
| 164755 | ** Return SQLITE_DONE if the update has been completely applied, or |
| @@ -164703,11 +164759,11 @@ | |
| 164759 | ** |
| 164760 | ** Once a call to sqlite3rbu_step() has returned a value other than |
| 164761 | ** SQLITE_OK, all subsequent calls on the same RBU handle are no-ops |
| 164762 | ** that immediately return the same value. |
| 164763 | */ |
| 164764 | SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *pRbu); |
| 164765 | |
| 164766 | /* |
| 164767 | ** Force RBU to save its state to disk. |
| 164768 | ** |
| 164769 | ** If a power failure or application crash occurs during an update, following |
| @@ -164715,11 +164771,11 @@ | |
| 164771 | ** was last saved. In other words, from the most recent successful call to |
| 164772 | ** sqlite3rbu_close() or this function. |
| 164773 | ** |
| 164774 | ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. |
| 164775 | */ |
| 164776 | SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *pRbu); |
| 164777 | |
| 164778 | /* |
| 164779 | ** Close an RBU handle. |
| 164780 | ** |
| 164781 | ** If the RBU update has been completely applied, mark the RBU database |
| @@ -164735,18 +164791,18 @@ | |
| 164791 | ** |
| 164792 | ** Otherwise, if no error occurs, this function returns SQLITE_OK if the |
| 164793 | ** update has been partially applied, or SQLITE_DONE if it has been |
| 164794 | ** completely applied. |
| 164795 | */ |
| 164796 | SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *pRbu, char **pzErrmsg); |
| 164797 | |
| 164798 | /* |
| 164799 | ** Return the total number of key-value operations (inserts, deletes or |
| 164800 | ** updates) that have been performed on the target database since the |
| 164801 | ** current RBU update was started. |
| 164802 | */ |
| 164803 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu); |
| 164804 | |
| 164805 | /* |
| 164806 | ** Obtain permyriadage (permyriadage is to 10000 as percentage is to 100) |
| 164807 | ** progress indications for the two stages of an RBU update. This API may |
| 164808 | ** be useful for driving GUI progress indicators and similar. |
| @@ -164784,11 +164840,11 @@ | |
| 164840 | ** permyriadage progress of the same stage. If the rbu_count table does |
| 164841 | ** not exist, then (*pnOne) is set to -1 during stage 1. If the rbu_count |
| 164842 | ** table exists but is not correctly populated, the value of the *pnOne |
| 164843 | ** output variable during stage 1 is undefined. |
| 164844 | */ |
| 164845 | SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *pRbu, int *pnOne, int *pnTwo); |
| 164846 | |
| 164847 | /* |
| 164848 | ** Obtain an indication as to the current stage of an RBU update or vacuum. |
| 164849 | ** This function always returns one of the SQLITE_RBU_STATE_XXX constants |
| 164850 | ** defined in this file. Return values should be interpreted as follows: |
| @@ -164822,11 +164878,11 @@ | |
| 164878 | #define SQLITE_RBU_STATE_MOVE 2 |
| 164879 | #define SQLITE_RBU_STATE_CHECKPOINT 3 |
| 164880 | #define SQLITE_RBU_STATE_DONE 4 |
| 164881 | #define SQLITE_RBU_STATE_ERROR 5 |
| 164882 | |
| 164883 | SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *pRbu); |
| 164884 | |
| 164885 | /* |
| 164886 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 164887 | ** via existing VFS zParent. Or, if the zParent parameter is passed NULL, |
| 164888 | ** then the new RBU VFS uses the default system VFS to access the file-system. |
| @@ -164866,21 +164922,21 @@ | |
| 164922 | ** The overhead of adding the "rbu" VFS to the system is negligible for |
| 164923 | ** non-RBU users. There is no harm in an application accessing the |
| 164924 | ** file-system via "rbu" all the time, even if it only uses RBU functionality |
| 164925 | ** occasionally. |
| 164926 | */ |
| 164927 | SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent); |
| 164928 | |
| 164929 | /* |
| 164930 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 164931 | ** sqlite3rbu_create_vfs(). |
| 164932 | ** |
| 164933 | ** VFS objects are not reference counted. If a VFS object is destroyed |
| 164934 | ** before all database handles that use it have been closed, the results |
| 164935 | ** are undefined. |
| 164936 | */ |
| 164937 | SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName); |
| 164938 | |
| 164939 | #if 0 |
| 164940 | } /* end of the 'extern "C"' block */ |
| 164941 | #endif |
| 164942 | |
| @@ -167970,11 +168026,11 @@ | |
| 168026 | } |
| 168027 | |
| 168028 | /* |
| 168029 | ** Step the RBU object. |
| 168030 | */ |
| 168031 | SQLITE_API int SQLITE_APICALL sqlite3rbu_step(sqlite3rbu *p){ |
| 168032 | if( p ){ |
| 168033 | switch( p->eStage ){ |
| 168034 | case RBU_STAGE_OAL: { |
| 168035 | RbuObjIter *pIter = &p->objiter; |
| 168036 | |
| @@ -168412,11 +168468,11 @@ | |
| 168468 | } |
| 168469 | |
| 168470 | /* |
| 168471 | ** Open and return a new RBU handle. |
| 168472 | */ |
| 168473 | SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_open( |
| 168474 | const char *zTarget, |
| 168475 | const char *zRbu, |
| 168476 | const char *zState |
| 168477 | ){ |
| 168478 | /* TODO: Check that zTarget and zRbu are non-NULL */ |
| @@ -168424,11 +168480,11 @@ | |
| 168480 | } |
| 168481 | |
| 168482 | /* |
| 168483 | ** Open a handle to begin or resume an RBU VACUUM operation. |
| 168484 | */ |
| 168485 | SQLITE_API sqlite3rbu *SQLITE_APICALL sqlite3rbu_vacuum( |
| 168486 | const char *zTarget, |
| 168487 | const char *zState |
| 168488 | ){ |
| 168489 | /* TODO: Check that both arguments are non-NULL */ |
| 168490 | return openRbuHandle(0, zTarget, zState); |
| @@ -168435,11 +168491,11 @@ | |
| 168491 | } |
| 168492 | |
| 168493 | /* |
| 168494 | ** Return the database handle used by pRbu. |
| 168495 | */ |
| 168496 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3rbu_db(sqlite3rbu *pRbu, int bRbu){ |
| 168497 | sqlite3 *db = 0; |
| 168498 | if( pRbu ){ |
| 168499 | db = (bRbu ? pRbu->dbRbu : pRbu->dbMain); |
| 168500 | } |
| 168501 | return db; |
| @@ -168467,11 +168523,11 @@ | |
| 168523 | } |
| 168524 | |
| 168525 | /* |
| 168526 | ** Close the RBU handle. |
| 168527 | */ |
| 168528 | SQLITE_API int SQLITE_APICALL sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){ |
| 168529 | int rc; |
| 168530 | if( p ){ |
| 168531 | |
| 168532 | /* Commit the transaction to the *-oal file. */ |
| 168533 | if( p->rc==SQLITE_OK && p->eStage==RBU_STAGE_OAL ){ |
| @@ -168518,19 +168574,19 @@ | |
| 168574 | /* |
| 168575 | ** Return the total number of key-value operations (inserts, deletes or |
| 168576 | ** updates) that have been performed on the target database since the |
| 168577 | ** current RBU update was started. |
| 168578 | */ |
| 168579 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3rbu_progress(sqlite3rbu *pRbu){ |
| 168580 | return pRbu->nProgress; |
| 168581 | } |
| 168582 | |
| 168583 | /* |
| 168584 | ** Return permyriadage progress indications for the two main stages of |
| 168585 | ** an RBU update. |
| 168586 | */ |
| 168587 | SQLITE_API void SQLITE_APICALL sqlite3rbu_bp_progress(sqlite3rbu *p, int *pnOne, int *pnTwo){ |
| 168588 | const int MAX_PROGRESS = 10000; |
| 168589 | switch( p->eStage ){ |
| 168590 | case RBU_STAGE_OAL: |
| 168591 | if( p->nPhaseOneStep>0 ){ |
| 168592 | *pnOne = (int)(MAX_PROGRESS * (i64)p->nProgress/(i64)p->nPhaseOneStep); |
| @@ -168561,11 +168617,11 @@ | |
| 168617 | } |
| 168618 | |
| 168619 | /* |
| 168620 | ** Return the current state of the RBU vacuum or update operation. |
| 168621 | */ |
| 168622 | SQLITE_API int SQLITE_APICALL sqlite3rbu_state(sqlite3rbu *p){ |
| 168623 | int aRes[] = { |
| 168624 | 0, SQLITE_RBU_STATE_OAL, SQLITE_RBU_STATE_MOVE, |
| 168625 | 0, SQLITE_RBU_STATE_CHECKPOINT, SQLITE_RBU_STATE_DONE |
| 168626 | }; |
| 168627 | |
| @@ -168589,11 +168645,11 @@ | |
| 168645 | ); |
| 168646 | return aRes[p->eStage]; |
| 168647 | } |
| 168648 | } |
| 168649 | |
| 168650 | SQLITE_API int SQLITE_APICALL sqlite3rbu_savestate(sqlite3rbu *p){ |
| 168651 | int rc = p->rc; |
| 168652 | if( rc==SQLITE_DONE ) return SQLITE_OK; |
| 168653 | |
| 168654 | assert( p->eStage>=RBU_STAGE_OAL && p->eStage<=RBU_STAGE_DONE ); |
| 168655 | if( p->eStage==RBU_STAGE_OAL ){ |
| @@ -169416,11 +169472,11 @@ | |
| 169472 | |
| 169473 | /* |
| 169474 | ** Deregister and destroy an RBU vfs created by an earlier call to |
| 169475 | ** sqlite3rbu_create_vfs(). |
| 169476 | */ |
| 169477 | SQLITE_API void SQLITE_APICALL sqlite3rbu_destroy_vfs(const char *zName){ |
| 169478 | sqlite3_vfs *pVfs = sqlite3_vfs_find(zName); |
| 169479 | if( pVfs && pVfs->xOpen==rbuVfsOpen ){ |
| 169480 | sqlite3_mutex_free(((rbu_vfs*)pVfs)->mutex); |
| 169481 | sqlite3_vfs_unregister(pVfs); |
| 169482 | sqlite3_free(pVfs); |
| @@ -169430,11 +169486,11 @@ | |
| 169486 | /* |
| 169487 | ** Create an RBU VFS named zName that accesses the underlying file-system |
| 169488 | ** via existing VFS zParent. The new object is registered as a non-default |
| 169489 | ** VFS with SQLite before returning. |
| 169490 | */ |
| 169491 | SQLITE_API int SQLITE_APICALL sqlite3rbu_create_vfs(const char *zName, const char *zParent){ |
| 169492 | |
| 169493 | /* Template for VFS */ |
| 169494 | static sqlite3_vfs vfs_template = { |
| 169495 | 1, /* iVersion */ |
| 169496 | 0, /* szOsFile */ |
| @@ -171675,11 +171731,11 @@ | |
| 171731 | } |
| 171732 | |
| 171733 | return rc; |
| 171734 | } |
| 171735 | |
| 171736 | SQLITE_API int SQLITE_APICALL sqlite3session_diff( |
| 171737 | sqlite3_session *pSession, |
| 171738 | const char *zFrom, |
| 171739 | const char *zTbl, |
| 171740 | char **pzErrMsg |
| 171741 | ){ |
| @@ -171769,11 +171825,11 @@ | |
| 171825 | |
| 171826 | /* |
| 171827 | ** Create a session object. This session object will record changes to |
| 171828 | ** database zDb attached to connection db. |
| 171829 | */ |
| 171830 | SQLITE_API int SQLITE_APICALL sqlite3session_create( |
| 171831 | sqlite3 *db, /* Database handle */ |
| 171832 | const char *zDb, /* Name of db (e.g. "main") */ |
| 171833 | sqlite3_session **ppSession /* OUT: New session object */ |
| 171834 | ){ |
| 171835 | sqlite3_session *pNew; /* Newly allocated session object */ |
| @@ -171831,11 +171887,11 @@ | |
| 171887 | } |
| 171888 | |
| 171889 | /* |
| 171890 | ** Delete a session object previously allocated using sqlite3session_create(). |
| 171891 | */ |
| 171892 | SQLITE_API void SQLITE_APICALL sqlite3session_delete(sqlite3_session *pSession){ |
| 171893 | sqlite3 *db = pSession->db; |
| 171894 | sqlite3_session *pHead; |
| 171895 | sqlite3_session **pp; |
| 171896 | |
| 171897 | /* Unlink the session from the linked list of sessions attached to the |
| @@ -171860,11 +171916,11 @@ | |
| 171916 | } |
| 171917 | |
| 171918 | /* |
| 171919 | ** Set a table filter on a Session Object. |
| 171920 | */ |
| 171921 | SQLITE_API void SQLITE_APICALL sqlite3session_table_filter( |
| 171922 | sqlite3_session *pSession, |
| 171923 | int(*xFilter)(void*, const char*), |
| 171924 | void *pCtx /* First argument passed to xFilter */ |
| 171925 | ){ |
| 171926 | pSession->bAutoAttach = 1; |
| @@ -171878,11 +171934,11 @@ | |
| 171934 | ** |
| 171935 | ** Only tables that have a PRIMARY KEY defined may be attached. It does |
| 171936 | ** not matter if the PRIMARY KEY is an "INTEGER PRIMARY KEY" (rowid alias) |
| 171937 | ** or not. |
| 171938 | */ |
| 171939 | SQLITE_API int SQLITE_APICALL sqlite3session_attach( |
| 171940 | sqlite3_session *pSession, /* Session object */ |
| 171941 | const char *zName /* Table name */ |
| 171942 | ){ |
| 171943 | int rc = SQLITE_OK; |
| 171944 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| @@ -172568,11 +172624,11 @@ | |
| 172624 | ** session object passed as the first argument. |
| 172625 | ** |
| 172626 | ** It is the responsibility of the caller to eventually free the buffer |
| 172627 | ** using sqlite3_free(). |
| 172628 | */ |
| 172629 | SQLITE_API int SQLITE_APICALL sqlite3session_changeset( |
| 172630 | sqlite3_session *pSession, /* Session object */ |
| 172631 | int *pnChangeset, /* OUT: Size of buffer at *ppChangeset */ |
| 172632 | void **ppChangeset /* OUT: Buffer containing changeset */ |
| 172633 | ){ |
| 172634 | return sessionGenerateChangeset(pSession, 0, 0, 0, pnChangeset, ppChangeset); |
| @@ -172579,11 +172635,11 @@ | |
| 172635 | } |
| 172636 | |
| 172637 | /* |
| 172638 | ** Streaming version of sqlite3session_changeset(). |
| 172639 | */ |
| 172640 | SQLITE_API int SQLITE_APICALL sqlite3session_changeset_strm( |
| 172641 | sqlite3_session *pSession, |
| 172642 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 172643 | void *pOut |
| 172644 | ){ |
| 172645 | return sessionGenerateChangeset(pSession, 0, xOutput, pOut, 0, 0); |
| @@ -172590,11 +172646,11 @@ | |
| 172646 | } |
| 172647 | |
| 172648 | /* |
| 172649 | ** Streaming version of sqlite3session_patchset(). |
| 172650 | */ |
| 172651 | SQLITE_API int SQLITE_APICALL sqlite3session_patchset_strm( |
| 172652 | sqlite3_session *pSession, |
| 172653 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 172654 | void *pOut |
| 172655 | ){ |
| 172656 | return sessionGenerateChangeset(pSession, 1, xOutput, pOut, 0, 0); |
| @@ -172605,11 +172661,11 @@ | |
| 172661 | ** session object passed as the first argument. |
| 172662 | ** |
| 172663 | ** It is the responsibility of the caller to eventually free the buffer |
| 172664 | ** using sqlite3_free(). |
| 172665 | */ |
| 172666 | SQLITE_API int SQLITE_APICALL sqlite3session_patchset( |
| 172667 | sqlite3_session *pSession, /* Session object */ |
| 172668 | int *pnPatchset, /* OUT: Size of buffer at *ppChangeset */ |
| 172669 | void **ppPatchset /* OUT: Buffer containing changeset */ |
| 172670 | ){ |
| 172671 | return sessionGenerateChangeset(pSession, 1, 0, 0, pnPatchset, ppPatchset); |
| @@ -172616,11 +172672,11 @@ | |
| 172672 | } |
| 172673 | |
| 172674 | /* |
| 172675 | ** Enable or disable the session object passed as the first argument. |
| 172676 | */ |
| 172677 | SQLITE_API int SQLITE_APICALL sqlite3session_enable(sqlite3_session *pSession, int bEnable){ |
| 172678 | int ret; |
| 172679 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172680 | if( bEnable>=0 ){ |
| 172681 | pSession->bEnable = bEnable; |
| 172682 | } |
| @@ -172630,11 +172686,11 @@ | |
| 172686 | } |
| 172687 | |
| 172688 | /* |
| 172689 | ** Enable or disable the session object passed as the first argument. |
| 172690 | */ |
| 172691 | SQLITE_API int SQLITE_APICALL sqlite3session_indirect(sqlite3_session *pSession, int bIndirect){ |
| 172692 | int ret; |
| 172693 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172694 | if( bIndirect>=0 ){ |
| 172695 | pSession->bIndirect = bIndirect; |
| 172696 | } |
| @@ -172645,11 +172701,11 @@ | |
| 172701 | |
| 172702 | /* |
| 172703 | ** Return true if there have been no changes to monitored tables recorded |
| 172704 | ** by the session object passed as the only argument. |
| 172705 | */ |
| 172706 | SQLITE_API int SQLITE_APICALL sqlite3session_isempty(sqlite3_session *pSession){ |
| 172707 | int ret = 0; |
| 172708 | SessionTable *pTab; |
| 172709 | |
| 172710 | sqlite3_mutex_enter(sqlite3_db_mutex(pSession->db)); |
| 172711 | for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){ |
| @@ -172695,11 +172751,11 @@ | |
| 172751 | } |
| 172752 | |
| 172753 | /* |
| 172754 | ** Create an iterator used to iterate through the contents of a changeset. |
| 172755 | */ |
| 172756 | SQLITE_API int SQLITE_APICALL sqlite3changeset_start( |
| 172757 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 172758 | int nChangeset, /* Size of buffer pChangeset in bytes */ |
| 172759 | void *pChangeset /* Pointer to buffer containing changeset */ |
| 172760 | ){ |
| 172761 | return sessionChangesetStart(pp, 0, 0, nChangeset, pChangeset); |
| @@ -172706,11 +172762,11 @@ | |
| 172762 | } |
| 172763 | |
| 172764 | /* |
| 172765 | ** Streaming version of sqlite3changeset_start(). |
| 172766 | */ |
| 172767 | SQLITE_API int SQLITE_APICALL sqlite3changeset_start_strm( |
| 172768 | sqlite3_changeset_iter **pp, /* OUT: Changeset iterator handle */ |
| 172769 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 172770 | void *pIn |
| 172771 | ){ |
| 172772 | return sessionChangesetStart(pp, xInput, pIn, 0, 0); |
| @@ -173127,20 +173183,20 @@ | |
| 173183 | ** or SQLITE_CORRUPT. |
| 173184 | ** |
| 173185 | ** This function may not be called on iterators passed to a conflict handler |
| 173186 | ** callback by changeset_apply(). |
| 173187 | */ |
| 173188 | SQLITE_API int SQLITE_APICALL sqlite3changeset_next(sqlite3_changeset_iter *p){ |
| 173189 | return sessionChangesetNext(p, 0, 0); |
| 173190 | } |
| 173191 | |
| 173192 | /* |
| 173193 | ** The following function extracts information on the current change |
| 173194 | ** from a changeset iterator. It may only be called after changeset_next() |
| 173195 | ** has returned SQLITE_ROW. |
| 173196 | */ |
| 173197 | SQLITE_API int SQLITE_APICALL sqlite3changeset_op( |
| 173198 | sqlite3_changeset_iter *pIter, /* Iterator handle */ |
| 173199 | const char **pzTab, /* OUT: Pointer to table name */ |
| 173200 | int *pnCol, /* OUT: Number of columns in table */ |
| 173201 | int *pOp, /* OUT: SQLITE_INSERT, DELETE or UPDATE */ |
| 173202 | int *pbIndirect /* OUT: True if change is indirect */ |
| @@ -173156,11 +173212,11 @@ | |
| 173212 | ** Return information regarding the PRIMARY KEY and number of columns in |
| 173213 | ** the database table affected by the change that pIter currently points |
| 173214 | ** to. This function may only be called after changeset_next() returns |
| 173215 | ** SQLITE_ROW. |
| 173216 | */ |
| 173217 | SQLITE_API int SQLITE_APICALL sqlite3changeset_pk( |
| 173218 | sqlite3_changeset_iter *pIter, /* Iterator object */ |
| 173219 | unsigned char **pabPK, /* OUT: Array of boolean - true for PK cols */ |
| 173220 | int *pnCol /* OUT: Number of entries in output array */ |
| 173221 | ){ |
| 173222 | *pabPK = pIter->abPK; |
| @@ -173179,11 +173235,11 @@ | |
| 173235 | ** was not modified and is not a PK column), set *ppValue to NULL. |
| 173236 | ** |
| 173237 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 173238 | ** not modified. Otherwise, SQLITE_OK. |
| 173239 | */ |
| 173240 | SQLITE_API int SQLITE_APICALL sqlite3changeset_old( |
| 173241 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173242 | int iVal, /* Index of old.* value to retrieve */ |
| 173243 | sqlite3_value **ppValue /* OUT: Old value (or NULL pointer) */ |
| 173244 | ){ |
| 173245 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_DELETE ){ |
| @@ -173207,11 +173263,11 @@ | |
| 173263 | ** was not modified), set *ppValue to NULL. |
| 173264 | ** |
| 173265 | ** If value iVal is out-of-range, SQLITE_RANGE is returned and *ppValue is |
| 173266 | ** not modified. Otherwise, SQLITE_OK. |
| 173267 | */ |
| 173268 | SQLITE_API int SQLITE_APICALL sqlite3changeset_new( |
| 173269 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173270 | int iVal, /* Index of new.* value to retrieve */ |
| 173271 | sqlite3_value **ppValue /* OUT: New value (or NULL pointer) */ |
| 173272 | ){ |
| 173273 | if( pIter->op!=SQLITE_UPDATE && pIter->op!=SQLITE_INSERT ){ |
| @@ -173241,11 +173297,11 @@ | |
| 173297 | ** containing the iVal'th value of the conflicting record. |
| 173298 | ** |
| 173299 | ** If value iVal is out-of-range or some other error occurs, an SQLite error |
| 173300 | ** code is returned. Otherwise, SQLITE_OK. |
| 173301 | */ |
| 173302 | SQLITE_API int SQLITE_APICALL sqlite3changeset_conflict( |
| 173303 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173304 | int iVal, /* Index of conflict record value to fetch */ |
| 173305 | sqlite3_value **ppValue /* OUT: Value from conflicting row */ |
| 173306 | ){ |
| 173307 | if( !pIter->pConflict ){ |
| @@ -173264,11 +173320,11 @@ | |
| 173320 | ** it sets the output variable to the total number of known foreign key |
| 173321 | ** violations in the destination database and returns SQLITE_OK. |
| 173322 | ** |
| 173323 | ** In all other cases this function returns SQLITE_MISUSE. |
| 173324 | */ |
| 173325 | SQLITE_API int SQLITE_APICALL sqlite3changeset_fk_conflicts( |
| 173326 | sqlite3_changeset_iter *pIter, /* Changeset iterator */ |
| 173327 | int *pnOut /* OUT: Number of FK violations */ |
| 173328 | ){ |
| 173329 | if( pIter->pConflict || pIter->apValue ){ |
| 173330 | return SQLITE_MISUSE; |
| @@ -173282,11 +173338,11 @@ | |
| 173338 | ** Finalize an iterator allocated with sqlite3changeset_start(). |
| 173339 | ** |
| 173340 | ** This function may not be called on iterators passed to a conflict handler |
| 173341 | ** callback by changeset_apply(). |
| 173342 | */ |
| 173343 | SQLITE_API int SQLITE_APICALL sqlite3changeset_finalize(sqlite3_changeset_iter *p){ |
| 173344 | int rc = SQLITE_OK; |
| 173345 | if( p ){ |
| 173346 | int i; /* Used to iterate through p->apValue[] */ |
| 173347 | rc = p->rc; |
| 173348 | if( p->apValue ){ |
| @@ -173456,11 +173512,11 @@ | |
| 173512 | |
| 173513 | |
| 173514 | /* |
| 173515 | ** Invert a changeset object. |
| 173516 | */ |
| 173517 | SQLITE_API int SQLITE_APICALL sqlite3changeset_invert( |
| 173518 | int nChangeset, /* Number of bytes in input */ |
| 173519 | const void *pChangeset, /* Input changeset */ |
| 173520 | int *pnInverted, /* OUT: Number of bytes in output changeset */ |
| 173521 | void **ppInverted /* OUT: Inverse of pChangeset */ |
| 173522 | ){ |
| @@ -173475,11 +173531,11 @@ | |
| 173531 | } |
| 173532 | |
| 173533 | /* |
| 173534 | ** Streaming version of sqlite3changeset_invert(). |
| 173535 | */ |
| 173536 | SQLITE_API int SQLITE_APICALL sqlite3changeset_invert_strm( |
| 173537 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 173538 | void *pIn, |
| 173539 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 173540 | void *pOut |
| 173541 | ){ |
| @@ -174355,11 +174411,11 @@ | |
| 174411 | /* |
| 174412 | ** Apply the changeset passed via pChangeset/nChangeset to the main database |
| 174413 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 174414 | ** to resolve any conflicts encountered while applying the change. |
| 174415 | */ |
| 174416 | SQLITE_API int SQLITE_APICALL sqlite3changeset_apply( |
| 174417 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 174418 | int nChangeset, /* Size of changeset in bytes */ |
| 174419 | void *pChangeset, /* Changeset blob */ |
| 174420 | int(*xFilter)( |
| 174421 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| @@ -174383,11 +174439,11 @@ | |
| 174439 | /* |
| 174440 | ** Apply the changeset passed via xInput/pIn to the main database |
| 174441 | ** attached to handle "db". Invoke the supplied conflict handler callback |
| 174442 | ** to resolve any conflicts encountered while applying the change. |
| 174443 | */ |
| 174444 | SQLITE_API int SQLITE_APICALL sqlite3changeset_apply_strm( |
| 174445 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 174446 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 174447 | void *pIn, /* First arg for xInput */ |
| 174448 | int(*xFilter)( |
| 174449 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| @@ -174718,11 +174774,11 @@ | |
| 174774 | } |
| 174775 | |
| 174776 | /* |
| 174777 | ** Allocate a new, empty, sqlite3_changegroup. |
| 174778 | */ |
| 174779 | SQLITE_API int SQLITE_APICALL sqlite3changegroup_new(sqlite3_changegroup **pp){ |
| 174780 | int rc = SQLITE_OK; /* Return code */ |
| 174781 | sqlite3_changegroup *p; /* New object */ |
| 174782 | p = (sqlite3_changegroup*)sqlite3_malloc(sizeof(sqlite3_changegroup)); |
| 174783 | if( p==0 ){ |
| 174784 | rc = SQLITE_NOMEM; |
| @@ -174735,11 +174791,11 @@ | |
| 174791 | |
| 174792 | /* |
| 174793 | ** Add the changeset currently stored in buffer pData, size nData bytes, |
| 174794 | ** to changeset-group p. |
| 174795 | */ |
| 174796 | SQLITE_API int SQLITE_APICALL sqlite3changegroup_add(sqlite3_changegroup *pGrp, int nData, void *pData){ |
| 174797 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| 174798 | int rc; /* Return code */ |
| 174799 | |
| 174800 | rc = sqlite3changeset_start(&pIter, nData, pData); |
| 174801 | if( rc==SQLITE_OK ){ |
| @@ -174751,11 +174807,11 @@ | |
| 174807 | |
| 174808 | /* |
| 174809 | ** Obtain a buffer containing a changeset representing the concatenation |
| 174810 | ** of all changesets added to the group so far. |
| 174811 | */ |
| 174812 | SQLITE_API int SQLITE_APICALL sqlite3changegroup_output( |
| 174813 | sqlite3_changegroup *pGrp, |
| 174814 | int *pnData, |
| 174815 | void **ppData |
| 174816 | ){ |
| 174817 | return sessionChangegroupOutput(pGrp, 0, 0, pnData, ppData); |
| @@ -174762,11 +174818,11 @@ | |
| 174818 | } |
| 174819 | |
| 174820 | /* |
| 174821 | ** Streaming versions of changegroup_add(). |
| 174822 | */ |
| 174823 | SQLITE_API int SQLITE_APICALL sqlite3changegroup_add_strm( |
| 174824 | sqlite3_changegroup *pGrp, |
| 174825 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 174826 | void *pIn |
| 174827 | ){ |
| 174828 | sqlite3_changeset_iter *pIter; /* Iterator opened on pData/nData */ |
| @@ -174781,11 +174837,11 @@ | |
| 174837 | } |
| 174838 | |
| 174839 | /* |
| 174840 | ** Streaming versions of changegroup_output(). |
| 174841 | */ |
| 174842 | SQLITE_API int SQLITE_APICALL sqlite3changegroup_output_strm( |
| 174843 | sqlite3_changegroup *pGrp, |
| 174844 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 174845 | void *pOut |
| 174846 | ){ |
| 174847 | return sessionChangegroupOutput(pGrp, xOutput, pOut, 0, 0); |
| @@ -174792,21 +174848,21 @@ | |
| 174848 | } |
| 174849 | |
| 174850 | /* |
| 174851 | ** Delete a changegroup object. |
| 174852 | */ |
| 174853 | SQLITE_API void SQLITE_APICALL sqlite3changegroup_delete(sqlite3_changegroup *pGrp){ |
| 174854 | if( pGrp ){ |
| 174855 | sessionDeleteTable(pGrp->pList); |
| 174856 | sqlite3_free(pGrp); |
| 174857 | } |
| 174858 | } |
| 174859 | |
| 174860 | /* |
| 174861 | ** Combine two changesets together. |
| 174862 | */ |
| 174863 | SQLITE_API int SQLITE_APICALL sqlite3changeset_concat( |
| 174864 | int nLeft, /* Number of bytes in lhs input */ |
| 174865 | void *pLeft, /* Lhs input changeset */ |
| 174866 | int nRight /* Number of bytes in rhs input */, |
| 174867 | void *pRight, /* Rhs input changeset */ |
| 174868 | int *pnOut, /* OUT: Number of bytes in output changeset */ |
| @@ -174831,11 +174887,11 @@ | |
| 174887 | } |
| 174888 | |
| 174889 | /* |
| 174890 | ** Streaming version of sqlite3changeset_concat(). |
| 174891 | */ |
| 174892 | SQLITE_API int SQLITE_APICALL sqlite3changeset_concat_strm( |
| 174893 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 174894 | void *pInA, |
| 174895 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| 174896 | void *pInB, |
| 174897 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| @@ -177062,11 +177118,11 @@ | |
| 177118 | |
| 177119 | #ifndef SQLITE_CORE |
| 177120 | #ifdef _WIN32 |
| 177121 | __declspec(dllexport) |
| 177122 | #endif |
| 177123 | SQLITE_API int SQLITE_APICALL sqlite3_json_init( |
| 177124 | sqlite3 *db, |
| 177125 | char **pzErrMsg, |
| 177126 | const sqlite3_api_routines *pApi |
| 177127 | ){ |
| 177128 | SQLITE_EXTENSION_INIT2(pApi); |
| @@ -193895,11 +193951,11 @@ | |
| 193951 | int nArg, /* Number of args */ |
| 193952 | sqlite3_value **apUnused /* Function arguments */ |
| 193953 | ){ |
| 193954 | assert( nArg==0 ); |
| 193955 | UNUSED_PARAM2(nArg, apUnused); |
| 193956 | sqlite3_result_text(pCtx, "fts5: 2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914", -1, SQLITE_TRANSIENT); |
| 193957 | } |
| 193958 | |
| 193959 | static int fts5Init(sqlite3 *db){ |
| 193960 | static const sqlite3_module fts5Mod = { |
| 193961 | /* iVersion */ 2, |
| @@ -193983,11 +194039,11 @@ | |
| 194039 | */ |
| 194040 | #ifndef SQLITE_CORE |
| 194041 | #ifdef _WIN32 |
| 194042 | __declspec(dllexport) |
| 194043 | #endif |
| 194044 | SQLITE_API int SQLITE_APICALL sqlite3_fts_init( |
| 194045 | sqlite3 *db, |
| 194046 | char **pzErrMsg, |
| 194047 | const sqlite3_api_routines *pApi |
| 194048 | ){ |
| 194049 | SQLITE_EXTENSION_INIT2(pApi); |
| @@ -193996,11 +194052,11 @@ | |
| 194052 | } |
| 194053 | |
| 194054 | #ifdef _WIN32 |
| 194055 | __declspec(dllexport) |
| 194056 | #endif |
| 194057 | SQLITE_API int SQLITE_APICALL sqlite3_fts5_init( |
| 194058 | sqlite3 *db, |
| 194059 | char **pzErrMsg, |
| 194060 | const sqlite3_api_routines *pApi |
| 194061 | ){ |
| 194062 | SQLITE_EXTENSION_INIT2(pApi); |
| 194063 |
+464
-450
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -52,12 +52,21 @@ | ||
| 52 | 52 | # define SQLITE_API |
| 53 | 53 | #endif |
| 54 | 54 | #ifndef SQLITE_CDECL |
| 55 | 55 | # define SQLITE_CDECL |
| 56 | 56 | #endif |
| 57 | +#ifndef SQLITE_APICALL | |
| 58 | +# define SQLITE_APICALL | |
| 59 | +#endif | |
| 57 | 60 | #ifndef SQLITE_STDCALL |
| 58 | -# define SQLITE_STDCALL | |
| 61 | +# define SQLITE_STDCALL SQLITE_APICALL | |
| 62 | +#endif | |
| 63 | +#ifndef SQLITE_CALLBACK | |
| 64 | +# define SQLITE_CALLBACK | |
| 65 | +#endif | |
| 66 | +#ifndef SQLITE_SYSAPI | |
| 67 | +# define SQLITE_SYSAPI | |
| 59 | 68 | #endif |
| 60 | 69 | |
| 61 | 70 | /* |
| 62 | 71 | ** These no-op macros are used in front of interfaces to mark those |
| 63 | 72 | ** interfaces as either deprecated or experimental. New applications |
| @@ -111,11 +120,11 @@ | ||
| 111 | 120 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | 121 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | 122 | */ |
| 114 | 123 | #define SQLITE_VERSION "3.14.0" |
| 115 | 124 | #define SQLITE_VERSION_NUMBER 3014000 |
| 116 | -#define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586" | |
| 125 | +#define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914" | |
| 117 | 126 | |
| 118 | 127 | /* |
| 119 | 128 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | 129 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | 130 | ** |
| @@ -144,13 +153,13 @@ | ||
| 144 | 153 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 145 | 154 | ** |
| 146 | 155 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 147 | 156 | */ |
| 148 | 157 | SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; |
| 149 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void); | |
| 150 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void); | |
| 151 | -SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void); | |
| 158 | +SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void); | |
| 159 | +SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void); | |
| 160 | +SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void); | |
| 152 | 161 | |
| 153 | 162 | /* |
| 154 | 163 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 155 | 164 | ** |
| 156 | 165 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| @@ -171,12 +180,12 @@ | ||
| 171 | 180 | ** |
| 172 | 181 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 173 | 182 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 174 | 183 | */ |
| 175 | 184 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 176 | -SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName); | |
| 177 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N); | |
| 185 | +SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName); | |
| 186 | +SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N); | |
| 178 | 187 | #endif |
| 179 | 188 | |
| 180 | 189 | /* |
| 181 | 190 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 182 | 191 | ** |
| @@ -211,11 +220,11 @@ | ||
| 211 | 220 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 212 | 221 | ** is unchanged by calls to sqlite3_config().)^ |
| 213 | 222 | ** |
| 214 | 223 | ** See the [threading mode] documentation for additional information. |
| 215 | 224 | */ |
| 216 | -SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void); | |
| 225 | +SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void); | |
| 217 | 226 | |
| 218 | 227 | /* |
| 219 | 228 | ** CAPI3REF: Database Connection Handle |
| 220 | 229 | ** KEYWORDS: {database connection} {database connections} |
| 221 | 230 | ** |
| @@ -308,19 +317,19 @@ | ||
| 308 | 317 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 309 | 318 | ** [sqlite3_open_v2()], and not previously closed. |
| 310 | 319 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 311 | 320 | ** argument is a harmless no-op. |
| 312 | 321 | */ |
| 313 | -SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*); | |
| 314 | -SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*); | |
| 322 | +SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*); | |
| 323 | +SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*); | |
| 315 | 324 | |
| 316 | 325 | /* |
| 317 | 326 | ** The type for a callback function. |
| 318 | 327 | ** This is legacy and deprecated. It is included for historical |
| 319 | 328 | ** compatibility and is not documented. |
| 320 | 329 | */ |
| 321 | -typedef int (*sqlite3_callback)(void*,int,char**, char**); | |
| 330 | +typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); | |
| 322 | 331 | |
| 323 | 332 | /* |
| 324 | 333 | ** CAPI3REF: One-Step Query Execution Interface |
| 325 | 334 | ** METHOD: sqlite3 |
| 326 | 335 | ** |
| @@ -380,14 +389,14 @@ | ||
| 380 | 389 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 381 | 390 | ** <li> The application must not modify the SQL statement text passed into |
| 382 | 391 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 383 | 392 | ** </ul> |
| 384 | 393 | */ |
| 385 | -SQLITE_API int SQLITE_STDCALL sqlite3_exec( | |
| 394 | +SQLITE_API int SQLITE_APICALL sqlite3_exec( | |
| 386 | 395 | sqlite3*, /* An open database */ |
| 387 | 396 | const char *sql, /* SQL to be evaluated */ |
| 388 | - int (*callback)(void*,int,char**,char**), /* Callback function */ | |
| 397 | + int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */ | |
| 389 | 398 | void *, /* 1st argument to callback */ |
| 390 | 399 | char **errmsg /* Error msg written here */ |
| 391 | 400 | ); |
| 392 | 401 | |
| 393 | 402 | /* |
| @@ -731,30 +740,30 @@ | ||
| 731 | 740 | ** database corruption. |
| 732 | 741 | */ |
| 733 | 742 | typedef struct sqlite3_io_methods sqlite3_io_methods; |
| 734 | 743 | struct sqlite3_io_methods { |
| 735 | 744 | int iVersion; |
| 736 | - int (*xClose)(sqlite3_file*); | |
| 737 | - int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); | |
| 738 | - int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); | |
| 739 | - int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); | |
| 740 | - int (*xSync)(sqlite3_file*, int flags); | |
| 741 | - int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); | |
| 742 | - int (*xLock)(sqlite3_file*, int); | |
| 743 | - int (*xUnlock)(sqlite3_file*, int); | |
| 744 | - int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); | |
| 745 | - int (*xFileControl)(sqlite3_file*, int op, void *pArg); | |
| 746 | - int (*xSectorSize)(sqlite3_file*); | |
| 747 | - int (*xDeviceCharacteristics)(sqlite3_file*); | |
| 745 | + int (SQLITE_CALLBACK *xClose)(sqlite3_file*); | |
| 746 | + int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); | |
| 747 | + int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); | |
| 748 | + int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size); | |
| 749 | + int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags); | |
| 750 | + int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); | |
| 751 | + int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int); | |
| 752 | + int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int); | |
| 753 | + int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut); | |
| 754 | + int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg); | |
| 755 | + int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*); | |
| 756 | + int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*); | |
| 748 | 757 | /* Methods above are valid for version 1 */ |
| 749 | - int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); | |
| 750 | - int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); | |
| 751 | - void (*xShmBarrier)(sqlite3_file*); | |
| 752 | - int (*xShmUnmap)(sqlite3_file*, int deleteFlag); | |
| 758 | + int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); | |
| 759 | + int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags); | |
| 760 | + void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*); | |
| 761 | + int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag); | |
| 753 | 762 | /* Methods above are valid for version 2 */ |
| 754 | - int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); | |
| 755 | - int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); | |
| 763 | + int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); | |
| 764 | + int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); | |
| 756 | 765 | /* Methods above are valid for version 3 */ |
| 757 | 766 | /* Additional methods may be added in future releases */ |
| 758 | 767 | }; |
| 759 | 768 | |
| 760 | 769 | /* |
| @@ -926,11 +935,11 @@ | ||
| 926 | 935 | ** ^The [SQLITE_FCNTL_BUSYHANDLER] |
| 927 | 936 | ** file-control may be invoked by SQLite on the database file handle |
| 928 | 937 | ** shortly after it is opened in order to provide a custom VFS with access |
| 929 | 938 | ** to the connections busy-handler callback. The argument is of type (void **) |
| 930 | 939 | ** - an array of two (void *) values. The first (void *) actually points |
| 931 | -** to a function of type (int (*)(void *)). In order to invoke the connections | |
| 940 | +** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections | |
| 932 | 941 | ** busy-handler, this function should be invoked with the second (void *) in |
| 933 | 942 | ** the array as the only argument. If it returns non-zero, then the operation |
| 934 | 943 | ** should be retried. If it returns zero, the custom VFS should abandon the |
| 935 | 944 | ** current operation. |
| 936 | 945 | ** |
| @@ -1192,43 +1201,43 @@ | ||
| 1192 | 1201 | ** or all of these interfaces to be NULL or for their behavior to change |
| 1193 | 1202 | ** from one release to the next. Applications must not attempt to access |
| 1194 | 1203 | ** any of these methods if the iVersion of the VFS is less than 3. |
| 1195 | 1204 | */ |
| 1196 | 1205 | typedef struct sqlite3_vfs sqlite3_vfs; |
| 1197 | -typedef void (*sqlite3_syscall_ptr)(void); | |
| 1206 | +typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void); | |
| 1198 | 1207 | struct sqlite3_vfs { |
| 1199 | 1208 | int iVersion; /* Structure version number (currently 3) */ |
| 1200 | 1209 | int szOsFile; /* Size of subclassed sqlite3_file */ |
| 1201 | 1210 | int mxPathname; /* Maximum file pathname length */ |
| 1202 | 1211 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1203 | 1212 | const char *zName; /* Name of this virtual file system */ |
| 1204 | 1213 | void *pAppData; /* Pointer to application-specific data */ |
| 1205 | - int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, | |
| 1214 | + int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, | |
| 1206 | 1215 | int flags, int *pOutFlags); |
| 1207 | - int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); | |
| 1208 | - int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); | |
| 1209 | - int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); | |
| 1210 | - void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); | |
| 1211 | - void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); | |
| 1212 | - void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); | |
| 1213 | - void (*xDlClose)(sqlite3_vfs*, void*); | |
| 1214 | - int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); | |
| 1215 | - int (*xSleep)(sqlite3_vfs*, int microseconds); | |
| 1216 | - int (*xCurrentTime)(sqlite3_vfs*, double*); | |
| 1217 | - int (*xGetLastError)(sqlite3_vfs*, int, char *); | |
| 1216 | + int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir); | |
| 1217 | + int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); | |
| 1218 | + int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); | |
| 1219 | + void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename); | |
| 1220 | + void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); | |
| 1221 | + void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); | |
| 1222 | + void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*); | |
| 1223 | + int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut); | |
| 1224 | + int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds); | |
| 1225 | + int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*); | |
| 1226 | + int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *); | |
| 1218 | 1227 | /* |
| 1219 | 1228 | ** The methods above are in version 1 of the sqlite_vfs object |
| 1220 | 1229 | ** definition. Those that follow are added in version 2 or later |
| 1221 | 1230 | */ |
| 1222 | - int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); | |
| 1231 | + int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); | |
| 1223 | 1232 | /* |
| 1224 | 1233 | ** The methods above are in versions 1 and 2 of the sqlite_vfs object. |
| 1225 | 1234 | ** Those below are for version 3 and greater. |
| 1226 | 1235 | */ |
| 1227 | - int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); | |
| 1228 | - sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1229 | - const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1236 | + int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); | |
| 1237 | + sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1238 | + const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName); | |
| 1230 | 1239 | /* |
| 1231 | 1240 | ** The methods above are in versions 1 through 3 of the sqlite_vfs object. |
| 1232 | 1241 | ** New fields may be appended in future versions. The iVersion |
| 1233 | 1242 | ** value will increment whenever this happens. |
| 1234 | 1243 | */ |
| @@ -1369,14 +1378,14 @@ | ||
| 1369 | 1378 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1370 | 1379 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1371 | 1380 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1372 | 1381 | ** failure. |
| 1373 | 1382 | */ |
| 1374 | -SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); | |
| 1375 | -SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); | |
| 1376 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); | |
| 1377 | -SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void); | |
| 1383 | +SQLITE_API int SQLITE_APICALL sqlite3_initialize(void); | |
| 1384 | +SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void); | |
| 1385 | +SQLITE_API int SQLITE_APICALL sqlite3_os_init(void); | |
| 1386 | +SQLITE_API int SQLITE_APICALL sqlite3_os_end(void); | |
| 1378 | 1387 | |
| 1379 | 1388 | /* |
| 1380 | 1389 | ** CAPI3REF: Configuring The SQLite Library |
| 1381 | 1390 | ** |
| 1382 | 1391 | ** The sqlite3_config() interface is used to make global configuration |
| @@ -1491,17 +1500,17 @@ | ||
| 1491 | 1500 | ** SQLite will never invoke xInit() more than once without an intervening |
| 1492 | 1501 | ** call to xShutdown(). |
| 1493 | 1502 | */ |
| 1494 | 1503 | typedef struct sqlite3_mem_methods sqlite3_mem_methods; |
| 1495 | 1504 | struct sqlite3_mem_methods { |
| 1496 | - void *(*xMalloc)(int); /* Memory allocation function */ | |
| 1497 | - void (*xFree)(void*); /* Free a prior allocation */ | |
| 1498 | - void *(*xRealloc)(void*,int); /* Resize an allocation */ | |
| 1499 | - int (*xSize)(void*); /* Return the size of an allocation */ | |
| 1500 | - int (*xRoundup)(int); /* Round up request size to allocation size */ | |
| 1501 | - int (*xInit)(void*); /* Initialize the memory allocator */ | |
| 1502 | - void (*xShutdown)(void*); /* Deinitialize the memory allocator */ | |
| 1505 | + void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */ | |
| 1506 | + void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */ | |
| 1507 | + void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */ | |
| 1508 | + int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */ | |
| 1509 | + int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */ | |
| 1510 | + int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */ | |
| 1511 | + void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */ | |
| 1503 | 1512 | void *pAppData; /* Argument to xInit() and xShutdown() */ |
| 1504 | 1513 | }; |
| 1505 | 1514 | |
| 1506 | 1515 | /* |
| 1507 | 1516 | ** CAPI3REF: Configuration Options |
| @@ -1714,11 +1723,11 @@ | ||
| 1714 | 1723 | ** |
| 1715 | 1724 | ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt> |
| 1716 | 1725 | ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite |
| 1717 | 1726 | ** global [error log]. |
| 1718 | 1727 | ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a |
| 1719 | -** function with a call signature of void(*)(void*,int,const char*), | |
| 1728 | +** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*), | |
| 1720 | 1729 | ** and a pointer to void. ^If the function pointer is not NULL, it is |
| 1721 | 1730 | ** invoked by [sqlite3_log()] to process each logging event. ^If the |
| 1722 | 1731 | ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. |
| 1723 | 1732 | ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is |
| 1724 | 1733 | ** passed through as the first parameter to the application-defined logger |
| @@ -1767,11 +1776,11 @@ | ||
| 1767 | 1776 | ** |
| 1768 | 1777 | ** [[SQLITE_CONFIG_SQLLOG]] |
| 1769 | 1778 | ** <dt>SQLITE_CONFIG_SQLLOG |
| 1770 | 1779 | ** <dd>This option is only available if sqlite is compiled with the |
| 1771 | 1780 | ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should |
| 1772 | -** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). | |
| 1781 | +** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int). | |
| 1773 | 1782 | ** The second should be of type (void*). The callback is invoked by the library |
| 1774 | 1783 | ** in three separate circumstances, identified by the value passed as the |
| 1775 | 1784 | ** fourth parameter. If the fourth parameter is 0, then the database connection |
| 1776 | 1785 | ** passed as the second argument has just been opened. The third argument |
| 1777 | 1786 | ** points to a buffer containing the name of the main database file. If the |
| @@ -1965,11 +1974,11 @@ | ||
| 1965 | 1974 | ** |
| 1966 | 1975 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 1967 | 1976 | ** [extended result codes] feature of SQLite. ^The extended result |
| 1968 | 1977 | ** codes are disabled by default for historical compatibility. |
| 1969 | 1978 | */ |
| 1970 | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff); | |
| 1979 | +SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff); | |
| 1971 | 1980 | |
| 1972 | 1981 | /* |
| 1973 | 1982 | ** CAPI3REF: Last Insert Rowid |
| 1974 | 1983 | ** METHOD: sqlite3 |
| 1975 | 1984 | ** |
| @@ -2017,11 +2026,11 @@ | ||
| 2017 | 2026 | ** function is running and thus changes the last insert [rowid], |
| 2018 | 2027 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2019 | 2028 | ** unpredictable and might not equal either the old or the new |
| 2020 | 2029 | ** last insert [rowid]. |
| 2021 | 2030 | */ |
| 2022 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*); | |
| 2031 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*); | |
| 2023 | 2032 | |
| 2024 | 2033 | /* |
| 2025 | 2034 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2026 | 2035 | ** METHOD: sqlite3 |
| 2027 | 2036 | ** |
| @@ -2070,11 +2079,11 @@ | ||
| 2070 | 2079 | ** |
| 2071 | 2080 | ** If a separate thread makes changes on the same database connection |
| 2072 | 2081 | ** while [sqlite3_changes()] is running then the value returned |
| 2073 | 2082 | ** is unpredictable and not meaningful. |
| 2074 | 2083 | */ |
| 2075 | -SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*); | |
| 2084 | +SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*); | |
| 2076 | 2085 | |
| 2077 | 2086 | /* |
| 2078 | 2087 | ** CAPI3REF: Total Number Of Rows Modified |
| 2079 | 2088 | ** METHOD: sqlite3 |
| 2080 | 2089 | ** |
| @@ -2094,11 +2103,11 @@ | ||
| 2094 | 2103 | ** |
| 2095 | 2104 | ** If a separate thread makes changes on the same database connection |
| 2096 | 2105 | ** while [sqlite3_total_changes()] is running then the value |
| 2097 | 2106 | ** returned is unpredictable and not meaningful. |
| 2098 | 2107 | */ |
| 2099 | -SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*); | |
| 2108 | +SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*); | |
| 2100 | 2109 | |
| 2101 | 2110 | /* |
| 2102 | 2111 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2103 | 2112 | ** METHOD: sqlite3 |
| 2104 | 2113 | ** |
| @@ -2134,11 +2143,11 @@ | ||
| 2134 | 2143 | ** that are started after the sqlite3_interrupt() call returns. |
| 2135 | 2144 | ** |
| 2136 | 2145 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2137 | 2146 | ** is running then bad things will likely happen. |
| 2138 | 2147 | */ |
| 2139 | -SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*); | |
| 2148 | +SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*); | |
| 2140 | 2149 | |
| 2141 | 2150 | /* |
| 2142 | 2151 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2143 | 2152 | ** |
| 2144 | 2153 | ** These routines are useful during command-line input to determine if the |
| @@ -2169,12 +2178,12 @@ | ||
| 2169 | 2178 | ** UTF-8 string. |
| 2170 | 2179 | ** |
| 2171 | 2180 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2172 | 2181 | ** UTF-16 string in native byte order. |
| 2173 | 2182 | */ |
| 2174 | -SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql); | |
| 2175 | -SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql); | |
| 2183 | +SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql); | |
| 2184 | +SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql); | |
| 2176 | 2185 | |
| 2177 | 2186 | /* |
| 2178 | 2187 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2179 | 2188 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2180 | 2189 | ** METHOD: sqlite3 |
| @@ -2231,11 +2240,11 @@ | ||
| 2231 | 2240 | ** result in undefined behavior. |
| 2232 | 2241 | ** |
| 2233 | 2242 | ** A busy handler must not close the database connection |
| 2234 | 2243 | ** or [prepared statement] that invoked the busy handler. |
| 2235 | 2244 | */ |
| 2236 | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); | |
| 2245 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); | |
| 2237 | 2246 | |
| 2238 | 2247 | /* |
| 2239 | 2248 | ** CAPI3REF: Set A Busy Timeout |
| 2240 | 2249 | ** METHOD: sqlite3 |
| 2241 | 2250 | ** |
| @@ -2254,11 +2263,11 @@ | ||
| 2254 | 2263 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2255 | 2264 | ** this routine, that other busy handler is cleared.)^ |
| 2256 | 2265 | ** |
| 2257 | 2266 | ** See also: [PRAGMA busy_timeout] |
| 2258 | 2267 | */ |
| 2259 | -SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms); | |
| 2268 | +SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms); | |
| 2260 | 2269 | |
| 2261 | 2270 | /* |
| 2262 | 2271 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2263 | 2272 | ** METHOD: sqlite3 |
| 2264 | 2273 | ** |
| @@ -2329,19 +2338,19 @@ | ||
| 2329 | 2338 | ** interface defined here. As a consequence, errors that occur in the |
| 2330 | 2339 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2331 | 2340 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2332 | 2341 | ** [sqlite3_errmsg()]. |
| 2333 | 2342 | */ |
| 2334 | -SQLITE_API int SQLITE_STDCALL sqlite3_get_table( | |
| 2343 | +SQLITE_API int SQLITE_APICALL sqlite3_get_table( | |
| 2335 | 2344 | sqlite3 *db, /* An open database */ |
| 2336 | 2345 | const char *zSql, /* SQL to be evaluated */ |
| 2337 | 2346 | char ***pazResult, /* Results of the query */ |
| 2338 | 2347 | int *pnRow, /* Number of result rows written here */ |
| 2339 | 2348 | int *pnColumn, /* Number of result columns written here */ |
| 2340 | 2349 | char **pzErrmsg /* Error msg written here */ |
| 2341 | 2350 | ); |
| 2342 | -SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result); | |
| 2351 | +SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result); | |
| 2343 | 2352 | |
| 2344 | 2353 | /* |
| 2345 | 2354 | ** CAPI3REF: Formatted String Printing Functions |
| 2346 | 2355 | ** |
| 2347 | 2356 | ** These routines are work-alikes of the "printf()" family of functions |
| @@ -2444,13 +2453,13 @@ | ||
| 2444 | 2453 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2445 | 2454 | ** addition that after the string has been read and copied into |
| 2446 | 2455 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2447 | 2456 | */ |
| 2448 | 2457 | SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2449 | -SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); | |
| 2458 | +SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list); | |
| 2450 | 2459 | SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2451 | -SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list); | |
| 2460 | +SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list); | |
| 2452 | 2461 | |
| 2453 | 2462 | /* |
| 2454 | 2463 | ** CAPI3REF: Memory Allocation Subsystem |
| 2455 | 2464 | ** |
| 2456 | 2465 | ** The SQLite core uses these three routines for all of its own |
| @@ -2536,16 +2545,16 @@ | ||
| 2536 | 2545 | ** |
| 2537 | 2546 | ** The application must not read or write any part of |
| 2538 | 2547 | ** a block of memory after it has been released using |
| 2539 | 2548 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2540 | 2549 | */ |
| 2541 | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int); | |
| 2542 | -SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64); | |
| 2543 | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int); | |
| 2544 | -SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64); | |
| 2545 | -SQLITE_API void SQLITE_STDCALL sqlite3_free(void*); | |
| 2546 | -SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*); | |
| 2550 | +SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int); | |
| 2551 | +SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64); | |
| 2552 | +SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int); | |
| 2553 | +SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64); | |
| 2554 | +SQLITE_API void SQLITE_APICALL sqlite3_free(void*); | |
| 2555 | +SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*); | |
| 2547 | 2556 | |
| 2548 | 2557 | /* |
| 2549 | 2558 | ** CAPI3REF: Memory Allocator Statistics |
| 2550 | 2559 | ** |
| 2551 | 2560 | ** SQLite provides these two interfaces for reporting on the status |
| @@ -2566,12 +2575,12 @@ | ||
| 2566 | 2575 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2567 | 2576 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2568 | 2577 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2569 | 2578 | ** prior to the reset. |
| 2570 | 2579 | */ |
| 2571 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void); | |
| 2572 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag); | |
| 2580 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void); | |
| 2581 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag); | |
| 2573 | 2582 | |
| 2574 | 2583 | /* |
| 2575 | 2584 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2576 | 2585 | ** |
| 2577 | 2586 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| @@ -2590,11 +2599,11 @@ | ||
| 2590 | 2599 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2591 | 2600 | ** non-NULL P then the pseudo-randomness is generated |
| 2592 | 2601 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2593 | 2602 | ** method. |
| 2594 | 2603 | */ |
| 2595 | -SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P); | |
| 2604 | +SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P); | |
| 2596 | 2605 | |
| 2597 | 2606 | /* |
| 2598 | 2607 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2599 | 2608 | ** METHOD: sqlite3 |
| 2600 | 2609 | ** |
| @@ -2673,13 +2682,13 @@ | ||
| 2673 | 2682 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2674 | 2683 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2675 | 2684 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2676 | 2685 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2677 | 2686 | */ |
| 2678 | -SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( | |
| 2687 | +SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer( | |
| 2679 | 2688 | sqlite3*, |
| 2680 | - int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), | |
| 2689 | + int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*), | |
| 2681 | 2690 | void *pUserData |
| 2682 | 2691 | ); |
| 2683 | 2692 | |
| 2684 | 2693 | /* |
| 2685 | 2694 | ** CAPI3REF: Authorizer Return Codes |
| @@ -2781,14 +2790,14 @@ | ||
| 2781 | 2790 | ** digits in the time are meaningless. Future versions of SQLite |
| 2782 | 2791 | ** might provide greater resolution on the profiler callback. The |
| 2783 | 2792 | ** sqlite3_profile() function is considered experimental and is |
| 2784 | 2793 | ** subject to change in future versions of SQLite. |
| 2785 | 2794 | */ |
| 2786 | -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*, | |
| 2787 | - void(*xTrace)(void*,const char*), void*); | |
| 2788 | -SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*, | |
| 2789 | - void(*xProfile)(void*,const char*,sqlite3_uint64), void*); | |
| 2795 | +SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*, | |
| 2796 | + void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*); | |
| 2797 | +SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*, | |
| 2798 | + void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*); | |
| 2790 | 2799 | |
| 2791 | 2800 | /* |
| 2792 | 2801 | ** CAPI3REF: SQL Trace Event Codes |
| 2793 | 2802 | ** KEYWORDS: SQLITE_TRACE |
| 2794 | 2803 | ** |
| @@ -2872,14 +2881,14 @@ | ||
| 2872 | 2881 | ** |
| 2873 | 2882 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 2874 | 2883 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 2875 | 2884 | ** are deprecated. |
| 2876 | 2885 | */ |
| 2877 | -SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( | |
| 2886 | +SQLITE_API int SQLITE_APICALL sqlite3_trace_v2( | |
| 2878 | 2887 | sqlite3*, |
| 2879 | 2888 | unsigned uMask, |
| 2880 | - int(*xCallback)(unsigned,void*,void*,void*), | |
| 2889 | + int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*), | |
| 2881 | 2890 | void *pCtx |
| 2882 | 2891 | ); |
| 2883 | 2892 | |
| 2884 | 2893 | /* |
| 2885 | 2894 | ** CAPI3REF: Query Progress Callbacks |
| @@ -2911,11 +2920,11 @@ | ||
| 2911 | 2920 | ** the database connection that invoked the progress handler. |
| 2912 | 2921 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 2913 | 2922 | ** database connections for the meaning of "modify" in this paragraph. |
| 2914 | 2923 | ** |
| 2915 | 2924 | */ |
| 2916 | -SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); | |
| 2925 | +SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*); | |
| 2917 | 2926 | |
| 2918 | 2927 | /* |
| 2919 | 2928 | ** CAPI3REF: Opening A New Database Connection |
| 2920 | 2929 | ** CONSTRUCTOR: sqlite3 |
| 2921 | 2930 | ** |
| @@ -3140,19 +3149,19 @@ | ||
| 3140 | 3149 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3141 | 3150 | ** features that require the use of temporary files may fail. |
| 3142 | 3151 | ** |
| 3143 | 3152 | ** See also: [sqlite3_temp_directory] |
| 3144 | 3153 | */ |
| 3145 | -SQLITE_API int SQLITE_STDCALL sqlite3_open( | |
| 3154 | +SQLITE_API int SQLITE_APICALL sqlite3_open( | |
| 3146 | 3155 | const char *filename, /* Database filename (UTF-8) */ |
| 3147 | 3156 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3148 | 3157 | ); |
| 3149 | -SQLITE_API int SQLITE_STDCALL sqlite3_open16( | |
| 3158 | +SQLITE_API int SQLITE_APICALL sqlite3_open16( | |
| 3150 | 3159 | const void *filename, /* Database filename (UTF-16) */ |
| 3151 | 3160 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3152 | 3161 | ); |
| 3153 | -SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( | |
| 3162 | +SQLITE_API int SQLITE_APICALL sqlite3_open_v2( | |
| 3154 | 3163 | const char *filename, /* Database filename (UTF-8) */ |
| 3155 | 3164 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3156 | 3165 | int flags, /* Flags */ |
| 3157 | 3166 | const char *zVfs /* Name of VFS module to use */ |
| 3158 | 3167 | ); |
| @@ -3194,13 +3203,13 @@ | ||
| 3194 | 3203 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3195 | 3204 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3196 | 3205 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3197 | 3206 | ** undesirable. |
| 3198 | 3207 | */ |
| 3199 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); | |
| 3200 | -SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); | |
| 3201 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); | |
| 3208 | +SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); | |
| 3209 | +SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); | |
| 3210 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); | |
| 3202 | 3211 | |
| 3203 | 3212 | |
| 3204 | 3213 | /* |
| 3205 | 3214 | ** CAPI3REF: Error Codes And Messages |
| 3206 | 3215 | ** METHOD: sqlite3 |
| @@ -3240,15 +3249,15 @@ | ||
| 3240 | 3249 | ** |
| 3241 | 3250 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3242 | 3251 | ** was invoked incorrectly by the application. In that case, the |
| 3243 | 3252 | ** error code and message may or may not be set. |
| 3244 | 3253 | */ |
| 3245 | -SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); | |
| 3246 | -SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); | |
| 3247 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); | |
| 3248 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); | |
| 3249 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int); | |
| 3254 | +SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db); | |
| 3255 | +SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db); | |
| 3256 | +SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*); | |
| 3257 | +SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*); | |
| 3258 | +SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int); | |
| 3250 | 3259 | |
| 3251 | 3260 | /* |
| 3252 | 3261 | ** CAPI3REF: Prepared Statement Object |
| 3253 | 3262 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3254 | 3263 | ** |
| @@ -3312,11 +3321,11 @@ | ||
| 3312 | 3321 | ** created by an untrusted script can be contained using the |
| 3313 | 3322 | ** [max_page_count] [PRAGMA]. |
| 3314 | 3323 | ** |
| 3315 | 3324 | ** New run-time limit categories may be added in future releases. |
| 3316 | 3325 | */ |
| 3317 | -SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal); | |
| 3326 | +SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal); | |
| 3318 | 3327 | |
| 3319 | 3328 | /* |
| 3320 | 3329 | ** CAPI3REF: Run-Time Limit Categories |
| 3321 | 3330 | ** KEYWORDS: {limit category} {*limit categories} |
| 3322 | 3331 | ** |
| @@ -3464,32 +3473,32 @@ | ||
| 3464 | 3473 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3465 | 3474 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3466 | 3475 | ** </li> |
| 3467 | 3476 | ** </ol> |
| 3468 | 3477 | */ |
| 3469 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare( | |
| 3478 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare( | |
| 3470 | 3479 | sqlite3 *db, /* Database handle */ |
| 3471 | 3480 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3472 | 3481 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3473 | 3482 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3474 | 3483 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3475 | 3484 | ); |
| 3476 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( | |
| 3485 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2( | |
| 3477 | 3486 | sqlite3 *db, /* Database handle */ |
| 3478 | 3487 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3479 | 3488 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3480 | 3489 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3481 | 3490 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3482 | 3491 | ); |
| 3483 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( | |
| 3492 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare16( | |
| 3484 | 3493 | sqlite3 *db, /* Database handle */ |
| 3485 | 3494 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3486 | 3495 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3487 | 3496 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3488 | 3497 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3489 | 3498 | ); |
| 3490 | -SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( | |
| 3499 | +SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2( | |
| 3491 | 3500 | sqlite3 *db, /* Database handle */ |
| 3492 | 3501 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3493 | 3502 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3494 | 3503 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3495 | 3504 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| @@ -3524,12 +3533,12 @@ | ||
| 3524 | 3533 | ** automatically freed when the prepared statement is finalized. |
| 3525 | 3534 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3526 | 3535 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3527 | 3536 | ** by passing it to [sqlite3_free()]. |
| 3528 | 3537 | */ |
| 3529 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt); | |
| 3530 | -SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); | |
| 3538 | +SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt); | |
| 3539 | +SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); | |
| 3531 | 3540 | |
| 3532 | 3541 | /* |
| 3533 | 3542 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3534 | 3543 | ** METHOD: sqlite3_stmt |
| 3535 | 3544 | ** |
| @@ -3557,11 +3566,11 @@ | ||
| 3557 | 3566 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3558 | 3567 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3559 | 3568 | ** change the configuration of a database connection, they do not make |
| 3560 | 3569 | ** changes to the content of the database files on disk. |
| 3561 | 3570 | */ |
| 3562 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); | |
| 3571 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); | |
| 3563 | 3572 | |
| 3564 | 3573 | /* |
| 3565 | 3574 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3566 | 3575 | ** METHOD: sqlite3_stmt |
| 3567 | 3576 | ** |
| @@ -3578,11 +3587,11 @@ | ||
| 3578 | 3587 | ** to locate all prepared statements associated with a database |
| 3579 | 3588 | ** connection that are in need of being reset. This can be used, |
| 3580 | 3589 | ** for example, in diagnostic routines to search for prepared |
| 3581 | 3590 | ** statements that are holding a transaction open. |
| 3582 | 3591 | */ |
| 3583 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*); | |
| 3592 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*); | |
| 3584 | 3593 | |
| 3585 | 3594 | /* |
| 3586 | 3595 | ** CAPI3REF: Dynamically Typed Value Object |
| 3587 | 3596 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3588 | 3597 | ** |
| @@ -3742,24 +3751,24 @@ | ||
| 3742 | 3751 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 3743 | 3752 | ** |
| 3744 | 3753 | ** See also: [sqlite3_bind_parameter_count()], |
| 3745 | 3754 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 3746 | 3755 | */ |
| 3747 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); | |
| 3748 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, | |
| 3749 | - void(*)(void*)); | |
| 3750 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double); | |
| 3751 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int); | |
| 3752 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); | |
| 3753 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int); | |
| 3754 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); | |
| 3755 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); | |
| 3756 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, | |
| 3757 | - void(*)(void*), unsigned char encoding); | |
| 3758 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); | |
| 3759 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); | |
| 3760 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); | |
| 3756 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*)); | |
| 3757 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, | |
| 3758 | + void(SQLITE_CALLBACK *)(void*)); | |
| 3759 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double); | |
| 3760 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int); | |
| 3761 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); | |
| 3762 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int); | |
| 3763 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*)); | |
| 3764 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 3765 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, | |
| 3766 | + void(SQLITE_CALLBACK *)(void*), unsigned char encoding); | |
| 3767 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); | |
| 3768 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); | |
| 3769 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); | |
| 3761 | 3770 | |
| 3762 | 3771 | /* |
| 3763 | 3772 | ** CAPI3REF: Number Of SQL Parameters |
| 3764 | 3773 | ** METHOD: sqlite3_stmt |
| 3765 | 3774 | ** |
| @@ -3776,11 +3785,11 @@ | ||
| 3776 | 3785 | ** |
| 3777 | 3786 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3778 | 3787 | ** [sqlite3_bind_parameter_name()], and |
| 3779 | 3788 | ** [sqlite3_bind_parameter_index()]. |
| 3780 | 3789 | */ |
| 3781 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*); | |
| 3790 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*); | |
| 3782 | 3791 | |
| 3783 | 3792 | /* |
| 3784 | 3793 | ** CAPI3REF: Name Of A Host Parameter |
| 3785 | 3794 | ** METHOD: sqlite3_stmt |
| 3786 | 3795 | ** |
| @@ -3804,11 +3813,11 @@ | ||
| 3804 | 3813 | ** |
| 3805 | 3814 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3806 | 3815 | ** [sqlite3_bind_parameter_count()], and |
| 3807 | 3816 | ** [sqlite3_bind_parameter_index()]. |
| 3808 | 3817 | */ |
| 3809 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); | |
| 3818 | +SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); | |
| 3810 | 3819 | |
| 3811 | 3820 | /* |
| 3812 | 3821 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 3813 | 3822 | ** METHOD: sqlite3_stmt |
| 3814 | 3823 | ** |
| @@ -3821,21 +3830,21 @@ | ||
| 3821 | 3830 | ** |
| 3822 | 3831 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3823 | 3832 | ** [sqlite3_bind_parameter_count()], and |
| 3824 | 3833 | ** [sqlite3_bind_parameter_name()]. |
| 3825 | 3834 | */ |
| 3826 | -SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); | |
| 3835 | +SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); | |
| 3827 | 3836 | |
| 3828 | 3837 | /* |
| 3829 | 3838 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 3830 | 3839 | ** METHOD: sqlite3_stmt |
| 3831 | 3840 | ** |
| 3832 | 3841 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 3833 | 3842 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 3834 | 3843 | ** ^Use this routine to reset all host parameters to NULL. |
| 3835 | 3844 | */ |
| 3836 | -SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*); | |
| 3845 | +SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*); | |
| 3837 | 3846 | |
| 3838 | 3847 | /* |
| 3839 | 3848 | ** CAPI3REF: Number Of Columns In A Result Set |
| 3840 | 3849 | ** METHOD: sqlite3_stmt |
| 3841 | 3850 | ** |
| @@ -3843,11 +3852,11 @@ | ||
| 3843 | 3852 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 3844 | 3853 | ** statement that does not return data (for example an [UPDATE]). |
| 3845 | 3854 | ** |
| 3846 | 3855 | ** See also: [sqlite3_data_count()] |
| 3847 | 3856 | */ |
| 3848 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt); | |
| 3857 | +SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt); | |
| 3849 | 3858 | |
| 3850 | 3859 | /* |
| 3851 | 3860 | ** CAPI3REF: Column Names In A Result Set |
| 3852 | 3861 | ** METHOD: sqlite3_stmt |
| 3853 | 3862 | ** |
| @@ -3872,12 +3881,12 @@ | ||
| 3872 | 3881 | ** ^The name of a result column is the value of the "AS" clause for |
| 3873 | 3882 | ** that column, if there is an AS clause. If there is no AS clause |
| 3874 | 3883 | ** then the name of the column is unspecified and may change from |
| 3875 | 3884 | ** one release of SQLite to the next. |
| 3876 | 3885 | */ |
| 3877 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N); | |
| 3878 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N); | |
| 3886 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N); | |
| 3887 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N); | |
| 3879 | 3888 | |
| 3880 | 3889 | /* |
| 3881 | 3890 | ** CAPI3REF: Source Of Data In A Query Result |
| 3882 | 3891 | ** METHOD: sqlite3_stmt |
| 3883 | 3892 | ** |
| @@ -3921,16 +3930,16 @@ | ||
| 3921 | 3930 | ** If two or more threads call one or more |
| 3922 | 3931 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 3923 | 3932 | ** for the same [prepared statement] and result column |
| 3924 | 3933 | ** at the same time then the results are undefined. |
| 3925 | 3934 | */ |
| 3926 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); | |
| 3927 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); | |
| 3928 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); | |
| 3929 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); | |
| 3930 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); | |
| 3931 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int); | |
| 3935 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int); | |
| 3936 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int); | |
| 3937 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int); | |
| 3938 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int); | |
| 3939 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int); | |
| 3940 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int); | |
| 3932 | 3941 | |
| 3933 | 3942 | /* |
| 3934 | 3943 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 3935 | 3944 | ** METHOD: sqlite3_stmt |
| 3936 | 3945 | ** |
| @@ -3958,12 +3967,12 @@ | ||
| 3958 | 3967 | ** data stored in that column is of the declared type. SQLite is |
| 3959 | 3968 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 3960 | 3969 | ** is associated with individual values, not with the containers |
| 3961 | 3970 | ** used to hold those values. |
| 3962 | 3971 | */ |
| 3963 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int); | |
| 3964 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int); | |
| 3972 | +SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int); | |
| 3973 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int); | |
| 3965 | 3974 | |
| 3966 | 3975 | /* |
| 3967 | 3976 | ** CAPI3REF: Evaluate An SQL Statement |
| 3968 | 3977 | ** METHOD: sqlite3_stmt |
| 3969 | 3978 | ** |
| @@ -4039,11 +4048,11 @@ | ||
| 4039 | 4048 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4040 | 4049 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4041 | 4050 | ** then the more specific [error codes] are returned directly |
| 4042 | 4051 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4043 | 4052 | */ |
| 4044 | -SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*); | |
| 4053 | +SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*); | |
| 4045 | 4054 | |
| 4046 | 4055 | /* |
| 4047 | 4056 | ** CAPI3REF: Number of columns in a result set |
| 4048 | 4057 | ** METHOD: sqlite3_stmt |
| 4049 | 4058 | ** |
| @@ -4060,11 +4069,11 @@ | ||
| 4060 | 4069 | ** where it always returns zero since each step of that multi-step |
| 4061 | 4070 | ** pragma returns 0 columns of data. |
| 4062 | 4071 | ** |
| 4063 | 4072 | ** See also: [sqlite3_column_count()] |
| 4064 | 4073 | */ |
| 4065 | -SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt); | |
| 4074 | +SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt); | |
| 4066 | 4075 | |
| 4067 | 4076 | /* |
| 4068 | 4077 | ** CAPI3REF: Fundamental Datatypes |
| 4069 | 4078 | ** KEYWORDS: SQLITE_TEXT |
| 4070 | 4079 | ** |
| @@ -4250,20 +4259,20 @@ | ||
| 4250 | 4259 | ** of these routines, a default value is returned. The default value |
| 4251 | 4260 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4252 | 4261 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4253 | 4262 | ** [SQLITE_NOMEM].)^ |
| 4254 | 4263 | */ |
| 4255 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol); | |
| 4256 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); | |
| 4257 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); | |
| 4258 | -SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol); | |
| 4259 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol); | |
| 4260 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol); | |
| 4261 | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol); | |
| 4262 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol); | |
| 4263 | -SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol); | |
| 4264 | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol); | |
| 4264 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol); | |
| 4265 | +SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); | |
| 4266 | +SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); | |
| 4267 | +SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol); | |
| 4268 | +SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol); | |
| 4269 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol); | |
| 4270 | +SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol); | |
| 4271 | +SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol); | |
| 4272 | +SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol); | |
| 4273 | +SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol); | |
| 4265 | 4274 | |
| 4266 | 4275 | /* |
| 4267 | 4276 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4268 | 4277 | ** DESTRUCTOR: sqlite3_stmt |
| 4269 | 4278 | ** |
| @@ -4287,11 +4296,11 @@ | ||
| 4287 | 4296 | ** resource leaks. It is a grievous error for the application to try to use |
| 4288 | 4297 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4289 | 4298 | ** statement after it has been finalized can result in undefined and |
| 4290 | 4299 | ** undesirable behavior such as segfaults and heap corruption. |
| 4291 | 4300 | */ |
| 4292 | -SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt); | |
| 4301 | +SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt); | |
| 4293 | 4302 | |
| 4294 | 4303 | /* |
| 4295 | 4304 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4296 | 4305 | ** METHOD: sqlite3_stmt |
| 4297 | 4306 | ** |
| @@ -4314,11 +4323,11 @@ | ||
| 4314 | 4323 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4315 | 4324 | ** |
| 4316 | 4325 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4317 | 4326 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4318 | 4327 | */ |
| 4319 | -SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt); | |
| 4328 | +SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt); | |
| 4320 | 4329 | |
| 4321 | 4330 | /* |
| 4322 | 4331 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4323 | 4332 | ** KEYWORDS: {function creation routines} |
| 4324 | 4333 | ** KEYWORDS: {application-defined SQL function} |
| @@ -4414,40 +4423,40 @@ | ||
| 4414 | 4423 | ** ^An application-defined function is permitted to call other |
| 4415 | 4424 | ** SQLite interfaces. However, such calls must not |
| 4416 | 4425 | ** close the database connection nor finalize or reset the prepared |
| 4417 | 4426 | ** statement in which the function is running. |
| 4418 | 4427 | */ |
| 4419 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function( | |
| 4428 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function( | |
| 4420 | 4429 | sqlite3 *db, |
| 4421 | 4430 | const char *zFunctionName, |
| 4422 | 4431 | int nArg, |
| 4423 | 4432 | int eTextRep, |
| 4424 | 4433 | void *pApp, |
| 4425 | - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4426 | - void (*xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4427 | - void (*xFinal)(sqlite3_context*) | |
| 4434 | + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4435 | + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4436 | + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) | |
| 4428 | 4437 | ); |
| 4429 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( | |
| 4438 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function16( | |
| 4430 | 4439 | sqlite3 *db, |
| 4431 | 4440 | const void *zFunctionName, |
| 4432 | 4441 | int nArg, |
| 4433 | 4442 | int eTextRep, |
| 4434 | 4443 | void *pApp, |
| 4435 | - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4436 | - void (*xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4437 | - void (*xFinal)(sqlite3_context*) | |
| 4444 | + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4445 | + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4446 | + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) | |
| 4438 | 4447 | ); |
| 4439 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( | |
| 4448 | +SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2( | |
| 4440 | 4449 | sqlite3 *db, |
| 4441 | 4450 | const char *zFunctionName, |
| 4442 | 4451 | int nArg, |
| 4443 | 4452 | int eTextRep, |
| 4444 | 4453 | void *pApp, |
| 4445 | - void (*xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4446 | - void (*xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4447 | - void (*xFinal)(sqlite3_context*), | |
| 4448 | - void(*xDestroy)(void*) | |
| 4454 | + void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 4455 | + void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), | |
| 4456 | + void (SQLITE_CALLBACK *xFinal)(sqlite3_context*), | |
| 4457 | + void(SQLITE_CALLBACK *xDestroy)(void*) | |
| 4449 | 4458 | ); |
| 4450 | 4459 | |
| 4451 | 4460 | /* |
| 4452 | 4461 | ** CAPI3REF: Text Encodings |
| 4453 | 4462 | ** |
| @@ -4480,16 +4489,16 @@ | ||
| 4480 | 4489 | ** to be supported. However, new applications should avoid |
| 4481 | 4490 | ** the use of these functions. To encourage programmers to avoid |
| 4482 | 4491 | ** these functions, we will not explain what they do. |
| 4483 | 4492 | */ |
| 4484 | 4493 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4485 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*); | |
| 4486 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*); | |
| 4487 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); | |
| 4488 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void); | |
| 4489 | -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void); | |
| 4490 | -SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), | |
| 4494 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*); | |
| 4495 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*); | |
| 4496 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); | |
| 4497 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void); | |
| 4498 | +SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void); | |
| 4499 | +SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int), | |
| 4491 | 4500 | void*,sqlite3_int64); |
| 4492 | 4501 | #endif |
| 4493 | 4502 | |
| 4494 | 4503 | /* |
| 4495 | 4504 | ** CAPI3REF: Obtaining SQL Values |
| @@ -4535,22 +4544,22 @@ | ||
| 4535 | 4544 | ** or [sqlite3_value_text16()]. |
| 4536 | 4545 | ** |
| 4537 | 4546 | ** These routines must be called from the same thread as |
| 4538 | 4547 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4539 | 4548 | */ |
| 4540 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*); | |
| 4541 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*); | |
| 4542 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*); | |
| 4543 | -SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*); | |
| 4544 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*); | |
| 4545 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*); | |
| 4546 | -SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*); | |
| 4547 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*); | |
| 4548 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*); | |
| 4549 | -SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*); | |
| 4550 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*); | |
| 4551 | -SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*); | |
| 4549 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*); | |
| 4550 | +SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*); | |
| 4551 | +SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*); | |
| 4552 | +SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*); | |
| 4553 | +SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*); | |
| 4554 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*); | |
| 4555 | +SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*); | |
| 4556 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*); | |
| 4557 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*); | |
| 4558 | +SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*); | |
| 4559 | +SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*); | |
| 4560 | +SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*); | |
| 4552 | 4561 | |
| 4553 | 4562 | /* |
| 4554 | 4563 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4555 | 4564 | ** METHOD: sqlite3_value |
| 4556 | 4565 | ** |
| @@ -4562,11 +4571,11 @@ | ||
| 4562 | 4571 | ** |
| 4563 | 4572 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4564 | 4573 | ** from the result of one [application-defined SQL function] into the |
| 4565 | 4574 | ** input of another. |
| 4566 | 4575 | */ |
| 4567 | -SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*); | |
| 4576 | +SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*); | |
| 4568 | 4577 | |
| 4569 | 4578 | /* |
| 4570 | 4579 | ** CAPI3REF: Copy And Free SQL Values |
| 4571 | 4580 | ** METHOD: sqlite3_value |
| 4572 | 4581 | ** |
| @@ -4578,12 +4587,12 @@ | ||
| 4578 | 4587 | ** |
| 4579 | 4588 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4580 | 4589 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4581 | 4590 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4582 | 4591 | */ |
| 4583 | -SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*); | |
| 4584 | -SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*); | |
| 4592 | +SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*); | |
| 4593 | +SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*); | |
| 4585 | 4594 | |
| 4586 | 4595 | /* |
| 4587 | 4596 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4588 | 4597 | ** METHOD: sqlite3_context |
| 4589 | 4598 | ** |
| @@ -4624,11 +4633,11 @@ | ||
| 4624 | 4633 | ** function. |
| 4625 | 4634 | ** |
| 4626 | 4635 | ** This routine must be called from the same thread in which |
| 4627 | 4636 | ** the aggregate SQL function is running. |
| 4628 | 4637 | */ |
| 4629 | -SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); | |
| 4638 | +SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); | |
| 4630 | 4639 | |
| 4631 | 4640 | /* |
| 4632 | 4641 | ** CAPI3REF: User Data For Functions |
| 4633 | 4642 | ** METHOD: sqlite3_context |
| 4634 | 4643 | ** |
| @@ -4639,11 +4648,11 @@ | ||
| 4639 | 4648 | ** registered the application defined function. |
| 4640 | 4649 | ** |
| 4641 | 4650 | ** This routine must be called from the same thread in which |
| 4642 | 4651 | ** the application-defined function is running. |
| 4643 | 4652 | */ |
| 4644 | -SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*); | |
| 4653 | +SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*); | |
| 4645 | 4654 | |
| 4646 | 4655 | /* |
| 4647 | 4656 | ** CAPI3REF: Database Connection For Functions |
| 4648 | 4657 | ** METHOD: sqlite3_context |
| 4649 | 4658 | ** |
| @@ -4651,11 +4660,11 @@ | ||
| 4651 | 4660 | ** the pointer to the [database connection] (the 1st parameter) |
| 4652 | 4661 | ** of the [sqlite3_create_function()] |
| 4653 | 4662 | ** and [sqlite3_create_function16()] routines that originally |
| 4654 | 4663 | ** registered the application defined function. |
| 4655 | 4664 | */ |
| 4656 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*); | |
| 4665 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*); | |
| 4657 | 4666 | |
| 4658 | 4667 | /* |
| 4659 | 4668 | ** CAPI3REF: Function Auxiliary Data |
| 4660 | 4669 | ** METHOD: sqlite3_context |
| 4661 | 4670 | ** |
| @@ -4704,12 +4713,12 @@ | ||
| 4704 | 4713 | ** values and [parameters] and expressions composed from the same.)^ |
| 4705 | 4714 | ** |
| 4706 | 4715 | ** These routines must be called from the same thread in which |
| 4707 | 4716 | ** the SQL function is running. |
| 4708 | 4717 | */ |
| 4709 | -SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N); | |
| 4710 | -SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); | |
| 4718 | +SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N); | |
| 4719 | +SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*)); | |
| 4711 | 4720 | |
| 4712 | 4721 | |
| 4713 | 4722 | /* |
| 4714 | 4723 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 4715 | 4724 | ** |
| @@ -4722,11 +4731,11 @@ | ||
| 4722 | 4731 | ** the content before returning. |
| 4723 | 4732 | ** |
| 4724 | 4733 | ** The typedef is necessary to work around problems in certain |
| 4725 | 4734 | ** C++ compilers. |
| 4726 | 4735 | */ |
| 4727 | -typedef void (*sqlite3_destructor_type)(void*); | |
| 4736 | +typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); | |
| 4728 | 4737 | #define SQLITE_STATIC ((sqlite3_destructor_type)0) |
| 4729 | 4738 | #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) |
| 4730 | 4739 | |
| 4731 | 4740 | /* |
| 4732 | 4741 | ** CAPI3REF: Setting The Result Of An SQL Function |
| @@ -4841,31 +4850,31 @@ | ||
| 4841 | 4850 | ** |
| 4842 | 4851 | ** If these routines are called from within the different thread |
| 4843 | 4852 | ** than the one containing the application-defined function that received |
| 4844 | 4853 | ** the [sqlite3_context] pointer, the results are undefined. |
| 4845 | 4854 | */ |
| 4846 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); | |
| 4847 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*, | |
| 4848 | - sqlite3_uint64,void(*)(void*)); | |
| 4849 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double); | |
| 4850 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int); | |
| 4851 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int); | |
| 4852 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*); | |
| 4853 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*); | |
| 4854 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int); | |
| 4855 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int); | |
| 4856 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); | |
| 4857 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*); | |
| 4858 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); | |
| 4859 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, | |
| 4860 | - void(*)(void*), unsigned char encoding); | |
| 4861 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); | |
| 4862 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); | |
| 4863 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); | |
| 4864 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); | |
| 4865 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); | |
| 4866 | -SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); | |
| 4855 | +SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 4856 | +SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*, | |
| 4857 | + sqlite3_uint64,void(SQLITE_CALLBACK *)(void*)); | |
| 4858 | +SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double); | |
| 4859 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int); | |
| 4860 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int); | |
| 4861 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*); | |
| 4862 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*); | |
| 4863 | +SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int); | |
| 4864 | +SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int); | |
| 4865 | +SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); | |
| 4866 | +SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*); | |
| 4867 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 4868 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, | |
| 4869 | + void(SQLITE_CALLBACK *)(void*), unsigned char encoding); | |
| 4870 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); | |
| 4871 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); | |
| 4872 | +SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); | |
| 4873 | +SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); | |
| 4874 | +SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n); | |
| 4875 | +SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); | |
| 4867 | 4876 | |
| 4868 | 4877 | |
| 4869 | 4878 | /* |
| 4870 | 4879 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 4871 | 4880 | ** METHOD: sqlite3_context |
| @@ -4876,11 +4885,11 @@ | ||
| 4876 | 4885 | ** of the subtype T are preserved in current versions of SQLite; |
| 4877 | 4886 | ** higher order bits are discarded. |
| 4878 | 4887 | ** The number of subtype bytes preserved by SQLite might increase |
| 4879 | 4888 | ** in future releases of SQLite. |
| 4880 | 4889 | */ |
| 4881 | -SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int); | |
| 4890 | +SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int); | |
| 4882 | 4891 | |
| 4883 | 4892 | /* |
| 4884 | 4893 | ** CAPI3REF: Define New Collating Sequences |
| 4885 | 4894 | ** METHOD: sqlite3 |
| 4886 | 4895 | ** |
| @@ -4958,31 +4967,31 @@ | ||
| 4958 | 4967 | ** is unfortunate but cannot be changed without breaking backwards |
| 4959 | 4968 | ** compatibility. |
| 4960 | 4969 | ** |
| 4961 | 4970 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 4962 | 4971 | */ |
| 4963 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( | |
| 4972 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation( | |
| 4964 | 4973 | sqlite3*, |
| 4965 | 4974 | const char *zName, |
| 4966 | 4975 | int eTextRep, |
| 4967 | 4976 | void *pArg, |
| 4968 | - int(*xCompare)(void*,int,const void*,int,const void*) | |
| 4977 | + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) | |
| 4969 | 4978 | ); |
| 4970 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( | |
| 4979 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2( | |
| 4971 | 4980 | sqlite3*, |
| 4972 | 4981 | const char *zName, |
| 4973 | 4982 | int eTextRep, |
| 4974 | 4983 | void *pArg, |
| 4975 | - int(*xCompare)(void*,int,const void*,int,const void*), | |
| 4976 | - void(*xDestroy)(void*) | |
| 4984 | + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*), | |
| 4985 | + void(SQLITE_CALLBACK *xDestroy)(void*) | |
| 4977 | 4986 | ); |
| 4978 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( | |
| 4987 | +SQLITE_API int SQLITE_APICALL sqlite3_create_collation16( | |
| 4979 | 4988 | sqlite3*, |
| 4980 | 4989 | const void *zName, |
| 4981 | 4990 | int eTextRep, |
| 4982 | 4991 | void *pArg, |
| 4983 | - int(*xCompare)(void*,int,const void*,int,const void*) | |
| 4992 | + int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) | |
| 4984 | 4993 | ); |
| 4985 | 4994 | |
| 4986 | 4995 | /* |
| 4987 | 4996 | ** CAPI3REF: Collation Needed Callbacks |
| 4988 | 4997 | ** METHOD: sqlite3 |
| @@ -5008,19 +5017,19 @@ | ||
| 5008 | 5017 | ** |
| 5009 | 5018 | ** The callback function should register the desired collation using |
| 5010 | 5019 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5011 | 5020 | ** [sqlite3_create_collation_v2()]. |
| 5012 | 5021 | */ |
| 5013 | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( | |
| 5022 | +SQLITE_API int SQLITE_APICALL sqlite3_collation_needed( | |
| 5014 | 5023 | sqlite3*, |
| 5015 | 5024 | void*, |
| 5016 | - void(*)(void*,sqlite3*,int eTextRep,const char*) | |
| 5025 | + void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*) | |
| 5017 | 5026 | ); |
| 5018 | -SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( | |
| 5027 | +SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16( | |
| 5019 | 5028 | sqlite3*, |
| 5020 | 5029 | void*, |
| 5021 | - void(*)(void*,sqlite3*,int eTextRep,const void*) | |
| 5030 | + void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*) | |
| 5022 | 5031 | ); |
| 5023 | 5032 | |
| 5024 | 5033 | #ifdef SQLITE_HAS_CODEC |
| 5025 | 5034 | /* |
| 5026 | 5035 | ** Specify the key for an encrypted database. This routine should be |
| @@ -5027,15 +5036,15 @@ | ||
| 5027 | 5036 | ** called right after sqlite3_open(). |
| 5028 | 5037 | ** |
| 5029 | 5038 | ** The code to implement this API is not available in the public release |
| 5030 | 5039 | ** of SQLite. |
| 5031 | 5040 | */ |
| 5032 | -SQLITE_API int SQLITE_STDCALL sqlite3_key( | |
| 5041 | +SQLITE_API int SQLITE_APICALL sqlite3_key( | |
| 5033 | 5042 | sqlite3 *db, /* Database to be rekeyed */ |
| 5034 | 5043 | const void *pKey, int nKey /* The key */ |
| 5035 | 5044 | ); |
| 5036 | -SQLITE_API int SQLITE_STDCALL sqlite3_key_v2( | |
| 5045 | +SQLITE_API int SQLITE_APICALL sqlite3_key_v2( | |
| 5037 | 5046 | sqlite3 *db, /* Database to be rekeyed */ |
| 5038 | 5047 | const char *zDbName, /* Name of the database */ |
| 5039 | 5048 | const void *pKey, int nKey /* The key */ |
| 5040 | 5049 | ); |
| 5041 | 5050 | |
| @@ -5045,35 +5054,35 @@ | ||
| 5045 | 5054 | ** database is decrypted. |
| 5046 | 5055 | ** |
| 5047 | 5056 | ** The code to implement this API is not available in the public release |
| 5048 | 5057 | ** of SQLite. |
| 5049 | 5058 | */ |
| 5050 | -SQLITE_API int SQLITE_STDCALL sqlite3_rekey( | |
| 5059 | +SQLITE_API int SQLITE_APICALL sqlite3_rekey( | |
| 5051 | 5060 | sqlite3 *db, /* Database to be rekeyed */ |
| 5052 | 5061 | const void *pKey, int nKey /* The new key */ |
| 5053 | 5062 | ); |
| 5054 | -SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2( | |
| 5063 | +SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2( | |
| 5055 | 5064 | sqlite3 *db, /* Database to be rekeyed */ |
| 5056 | 5065 | const char *zDbName, /* Name of the database */ |
| 5057 | 5066 | const void *pKey, int nKey /* The new key */ |
| 5058 | 5067 | ); |
| 5059 | 5068 | |
| 5060 | 5069 | /* |
| 5061 | 5070 | ** Specify the activation key for a SEE database. Unless |
| 5062 | 5071 | ** activated, none of the SEE routines will work. |
| 5063 | 5072 | */ |
| 5064 | -SQLITE_API void SQLITE_STDCALL sqlite3_activate_see( | |
| 5073 | +SQLITE_API void SQLITE_APICALL sqlite3_activate_see( | |
| 5065 | 5074 | const char *zPassPhrase /* Activation phrase */ |
| 5066 | 5075 | ); |
| 5067 | 5076 | #endif |
| 5068 | 5077 | |
| 5069 | 5078 | #ifdef SQLITE_ENABLE_CEROD |
| 5070 | 5079 | /* |
| 5071 | 5080 | ** Specify the activation key for a CEROD database. Unless |
| 5072 | 5081 | ** activated, none of the CEROD routines will work. |
| 5073 | 5082 | */ |
| 5074 | -SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod( | |
| 5083 | +SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod( | |
| 5075 | 5084 | const char *zPassPhrase /* Activation phrase */ |
| 5076 | 5085 | ); |
| 5077 | 5086 | #endif |
| 5078 | 5087 | |
| 5079 | 5088 | /* |
| @@ -5091,11 +5100,11 @@ | ||
| 5091 | 5100 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5092 | 5101 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5093 | 5102 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5094 | 5103 | ** in the previous paragraphs. |
| 5095 | 5104 | */ |
| 5096 | -SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int); | |
| 5105 | +SQLITE_API int SQLITE_APICALL sqlite3_sleep(int); | |
| 5097 | 5106 | |
| 5098 | 5107 | /* |
| 5099 | 5108 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5100 | 5109 | ** |
| 5101 | 5110 | ** ^(If this global variable is made to point to a string which is |
| @@ -5210,11 +5219,11 @@ | ||
| 5210 | 5219 | ** |
| 5211 | 5220 | ** If another thread changes the autocommit status of the database |
| 5212 | 5221 | ** connection while this routine is running, then the return value |
| 5213 | 5222 | ** is undefined. |
| 5214 | 5223 | */ |
| 5215 | -SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*); | |
| 5224 | +SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*); | |
| 5216 | 5225 | |
| 5217 | 5226 | /* |
| 5218 | 5227 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5219 | 5228 | ** METHOD: sqlite3_stmt |
| 5220 | 5229 | ** |
| @@ -5223,11 +5232,11 @@ | ||
| 5223 | 5232 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5224 | 5233 | ** that was the first argument |
| 5225 | 5234 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5226 | 5235 | ** create the statement in the first place. |
| 5227 | 5236 | */ |
| 5228 | -SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*); | |
| 5237 | +SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*); | |
| 5229 | 5238 | |
| 5230 | 5239 | /* |
| 5231 | 5240 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5232 | 5241 | ** METHOD: sqlite3 |
| 5233 | 5242 | ** |
| @@ -5240,21 +5249,21 @@ | ||
| 5240 | 5249 | ** ^The filename returned by this function is the output of the |
| 5241 | 5250 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5242 | 5251 | ** will be an absolute pathname, even if the filename used |
| 5243 | 5252 | ** to open the database originally was a URI or relative pathname. |
| 5244 | 5253 | */ |
| 5245 | -SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); | |
| 5254 | +SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); | |
| 5246 | 5255 | |
| 5247 | 5256 | /* |
| 5248 | 5257 | ** CAPI3REF: Determine if a database is read-only |
| 5249 | 5258 | ** METHOD: sqlite3 |
| 5250 | 5259 | ** |
| 5251 | 5260 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5252 | 5261 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5253 | 5262 | ** the name of a database on connection D. |
| 5254 | 5263 | */ |
| 5255 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); | |
| 5264 | +SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); | |
| 5256 | 5265 | |
| 5257 | 5266 | /* |
| 5258 | 5267 | ** CAPI3REF: Find the next prepared statement |
| 5259 | 5268 | ** METHOD: sqlite3 |
| 5260 | 5269 | ** |
| @@ -5266,11 +5275,11 @@ | ||
| 5266 | 5275 | ** |
| 5267 | 5276 | ** The [database connection] pointer D in a call to |
| 5268 | 5277 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5269 | 5278 | ** connection and in particular must not be a NULL pointer. |
| 5270 | 5279 | */ |
| 5271 | -SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); | |
| 5280 | +SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); | |
| 5272 | 5281 | |
| 5273 | 5282 | /* |
| 5274 | 5283 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5275 | 5284 | ** METHOD: sqlite3 |
| 5276 | 5285 | ** |
| @@ -5315,12 +5324,12 @@ | ||
| 5315 | 5324 | ** ^The rollback callback is not invoked if a transaction is |
| 5316 | 5325 | ** automatically rolled back because the database connection is closed. |
| 5317 | 5326 | ** |
| 5318 | 5327 | ** See also the [sqlite3_update_hook()] interface. |
| 5319 | 5328 | */ |
| 5320 | -SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); | |
| 5321 | -SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); | |
| 5329 | +SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*); | |
| 5330 | +SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); | |
| 5322 | 5331 | |
| 5323 | 5332 | /* |
| 5324 | 5333 | ** CAPI3REF: Data Change Notification Callbacks |
| 5325 | 5334 | ** METHOD: sqlite3 |
| 5326 | 5335 | ** |
| @@ -5367,13 +5376,13 @@ | ||
| 5367 | 5376 | ** the first call on D. |
| 5368 | 5377 | ** |
| 5369 | 5378 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5370 | 5379 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5371 | 5380 | */ |
| 5372 | -SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( | |
| 5381 | +SQLITE_API void *SQLITE_APICALL sqlite3_update_hook( | |
| 5373 | 5382 | sqlite3*, |
| 5374 | - void(*)(void *,int ,char const *,char const *,sqlite3_int64), | |
| 5383 | + void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64), | |
| 5375 | 5384 | void* |
| 5376 | 5385 | ); |
| 5377 | 5386 | |
| 5378 | 5387 | /* |
| 5379 | 5388 | ** CAPI3REF: Enable Or Disable Shared Pager Cache |
| @@ -5407,11 +5416,11 @@ | ||
| 5407 | 5416 | ** This interface is threadsafe on processors where writing a |
| 5408 | 5417 | ** 32-bit integer is atomic. |
| 5409 | 5418 | ** |
| 5410 | 5419 | ** See Also: [SQLite Shared-Cache Mode] |
| 5411 | 5420 | */ |
| 5412 | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int); | |
| 5421 | +SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int); | |
| 5413 | 5422 | |
| 5414 | 5423 | /* |
| 5415 | 5424 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5416 | 5425 | ** |
| 5417 | 5426 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| @@ -5423,11 +5432,11 @@ | ||
| 5423 | 5432 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5424 | 5433 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5425 | 5434 | ** |
| 5426 | 5435 | ** See also: [sqlite3_db_release_memory()] |
| 5427 | 5436 | */ |
| 5428 | -SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int); | |
| 5437 | +SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int); | |
| 5429 | 5438 | |
| 5430 | 5439 | /* |
| 5431 | 5440 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5432 | 5441 | ** METHOD: sqlite3 |
| 5433 | 5442 | ** |
| @@ -5437,11 +5446,11 @@ | ||
| 5437 | 5446 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5438 | 5447 | ** omitted. |
| 5439 | 5448 | ** |
| 5440 | 5449 | ** See also: [sqlite3_release_memory()] |
| 5441 | 5450 | */ |
| 5442 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*); | |
| 5451 | +SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*); | |
| 5443 | 5452 | |
| 5444 | 5453 | /* |
| 5445 | 5454 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5446 | 5455 | ** |
| 5447 | 5456 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| @@ -5489,11 +5498,11 @@ | ||
| 5489 | 5498 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5490 | 5499 | ** |
| 5491 | 5500 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5492 | 5501 | ** changes in future releases of SQLite. |
| 5493 | 5502 | */ |
| 5494 | -SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N); | |
| 5503 | +SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N); | |
| 5495 | 5504 | |
| 5496 | 5505 | /* |
| 5497 | 5506 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5498 | 5507 | ** DEPRECATED |
| 5499 | 5508 | ** |
| @@ -5500,11 +5509,11 @@ | ||
| 5500 | 5509 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5501 | 5510 | ** interface. This routine is provided for historical compatibility |
| 5502 | 5511 | ** only. All new applications should use the |
| 5503 | 5512 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5504 | 5513 | */ |
| 5505 | -SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N); | |
| 5514 | +SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N); | |
| 5506 | 5515 | |
| 5507 | 5516 | |
| 5508 | 5517 | /* |
| 5509 | 5518 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5510 | 5519 | ** METHOD: sqlite3 |
| @@ -5570,11 +5579,11 @@ | ||
| 5570 | 5579 | ** |
| 5571 | 5580 | ** ^This function causes all database schemas to be read from disk and |
| 5572 | 5581 | ** parsed, if that has not already been done, and returns an error if |
| 5573 | 5582 | ** any errors are encountered while loading the schema. |
| 5574 | 5583 | */ |
| 5575 | -SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( | |
| 5584 | +SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata( | |
| 5576 | 5585 | sqlite3 *db, /* Connection handle */ |
| 5577 | 5586 | const char *zDbName, /* Database name or NULL */ |
| 5578 | 5587 | const char *zTableName, /* Table name */ |
| 5579 | 5588 | const char *zColumnName, /* Column name */ |
| 5580 | 5589 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -5626,11 +5635,11 @@ | ||
| 5626 | 5635 | ** disabled and prevent SQL injections from giving attackers |
| 5627 | 5636 | ** access to extension loading capabilities. |
| 5628 | 5637 | ** |
| 5629 | 5638 | ** See also the [load_extension() SQL function]. |
| 5630 | 5639 | */ |
| 5631 | -SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( | |
| 5640 | +SQLITE_API int SQLITE_APICALL sqlite3_load_extension( | |
| 5632 | 5641 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5633 | 5642 | const char *zFile, /* Name of the shared library containing extension */ |
| 5634 | 5643 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5635 | 5644 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5636 | 5645 | ); |
| @@ -5658,11 +5667,11 @@ | ||
| 5658 | 5667 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5659 | 5668 | ** rather than this interface, so the [load_extension()] SQL function |
| 5660 | 5669 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5661 | 5670 | ** access to extension loading capabilities. |
| 5662 | 5671 | */ |
| 5663 | -SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); | |
| 5672 | +SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); | |
| 5664 | 5673 | |
| 5665 | 5674 | /* |
| 5666 | 5675 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5667 | 5676 | ** |
| 5668 | 5677 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| @@ -5696,11 +5705,14 @@ | ||
| 5696 | 5705 | ** will be called more than once for each database connection that is opened. |
| 5697 | 5706 | ** |
| 5698 | 5707 | ** See also: [sqlite3_reset_auto_extension()] |
| 5699 | 5708 | ** and [sqlite3_cancel_auto_extension()] |
| 5700 | 5709 | */ |
| 5701 | -SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void)); | |
| 5710 | +typedef struct sqlite3_api_routines sqlite3_api_routines; | |
| 5711 | +SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( | |
| 5712 | + int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) | |
| 5713 | +); | |
| 5702 | 5714 | |
| 5703 | 5715 | /* |
| 5704 | 5716 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5705 | 5717 | ** |
| 5706 | 5718 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| @@ -5708,19 +5720,21 @@ | ||
| 5708 | 5720 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5709 | 5721 | ** routine returns 1 if initialization routine X was successfully |
| 5710 | 5722 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5711 | 5723 | ** routines. |
| 5712 | 5724 | */ |
| 5713 | -SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); | |
| 5725 | +SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( | |
| 5726 | + int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) | |
| 5727 | +); | |
| 5714 | 5728 | |
| 5715 | 5729 | /* |
| 5716 | 5730 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5717 | 5731 | ** |
| 5718 | 5732 | ** ^This interface disables all automatic extensions previously |
| 5719 | 5733 | ** registered using [sqlite3_auto_extension()]. |
| 5720 | 5734 | */ |
| 5721 | -SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void); | |
| 5735 | +SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void); | |
| 5722 | 5736 | |
| 5723 | 5737 | /* |
| 5724 | 5738 | ** The interface to the virtual-table mechanism is currently considered |
| 5725 | 5739 | ** to be experimental. The interface might change in incompatible ways. |
| 5726 | 5740 | ** If this is a problem for you, do not use the interface at this time. |
| @@ -5753,41 +5767,41 @@ | ||
| 5753 | 5767 | ** of this structure must not change while it is registered with |
| 5754 | 5768 | ** any database connection. |
| 5755 | 5769 | */ |
| 5756 | 5770 | struct sqlite3_module { |
| 5757 | 5771 | int iVersion; |
| 5758 | - int (*xCreate)(sqlite3*, void *pAux, | |
| 5759 | - int argc, const char *const*argv, | |
| 5760 | - sqlite3_vtab **ppVTab, char**); | |
| 5761 | - int (*xConnect)(sqlite3*, void *pAux, | |
| 5762 | - int argc, const char *const*argv, | |
| 5763 | - sqlite3_vtab **ppVTab, char**); | |
| 5764 | - int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); | |
| 5765 | - int (*xDisconnect)(sqlite3_vtab *pVTab); | |
| 5766 | - int (*xDestroy)(sqlite3_vtab *pVTab); | |
| 5767 | - int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); | |
| 5768 | - int (*xClose)(sqlite3_vtab_cursor*); | |
| 5769 | - int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, | |
| 5770 | - int argc, sqlite3_value **argv); | |
| 5771 | - int (*xNext)(sqlite3_vtab_cursor*); | |
| 5772 | - int (*xEof)(sqlite3_vtab_cursor*); | |
| 5773 | - int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); | |
| 5774 | - int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); | |
| 5775 | - int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); | |
| 5776 | - int (*xBegin)(sqlite3_vtab *pVTab); | |
| 5777 | - int (*xSync)(sqlite3_vtab *pVTab); | |
| 5778 | - int (*xCommit)(sqlite3_vtab *pVTab); | |
| 5779 | - int (*xRollback)(sqlite3_vtab *pVTab); | |
| 5780 | - int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, | |
| 5781 | - void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 5782 | - void **ppArg); | |
| 5783 | - int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); | |
| 5784 | - /* The methods above are in version 1 of the sqlite_module object. Those | |
| 5785 | - ** below are for version 2 and greater. */ | |
| 5786 | - int (*xSavepoint)(sqlite3_vtab *pVTab, int); | |
| 5787 | - int (*xRelease)(sqlite3_vtab *pVTab, int); | |
| 5788 | - int (*xRollbackTo)(sqlite3_vtab *pVTab, int); | |
| 5772 | + int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux, | |
| 5773 | + int argc, const char *const*argv, | |
| 5774 | + sqlite3_vtab **ppVTab, char**); | |
| 5775 | + int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux, | |
| 5776 | + int argc, const char *const*argv, | |
| 5777 | + sqlite3_vtab **ppVTab, char**); | |
| 5778 | + int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); | |
| 5779 | + int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab); | |
| 5780 | + int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab); | |
| 5781 | + int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); | |
| 5782 | + int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*); | |
| 5783 | + int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, | |
| 5784 | + int argc, sqlite3_value **argv); | |
| 5785 | + int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*); | |
| 5786 | + int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*); | |
| 5787 | + int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); | |
| 5788 | + int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); | |
| 5789 | + int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); | |
| 5790 | + int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab); | |
| 5791 | + int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab); | |
| 5792 | + int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab); | |
| 5793 | + int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab); | |
| 5794 | + int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, | |
| 5795 | + void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**), | |
| 5796 | + void **ppArg); | |
| 5797 | + int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew); | |
| 5798 | + /* The methods above are in version 1 of the sqlite_module object. Those | |
| 5799 | + ** below are for version 2 and greater. */ | |
| 5800 | + int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int); | |
| 5801 | + int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int); | |
| 5802 | + int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int); | |
| 5789 | 5803 | }; |
| 5790 | 5804 | |
| 5791 | 5805 | /* |
| 5792 | 5806 | ** CAPI3REF: Virtual Table Indexing Information |
| 5793 | 5807 | ** KEYWORDS: sqlite3_index_info |
| @@ -5961,22 +5975,22 @@ | ||
| 5961 | 5975 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 5962 | 5976 | ** ^The sqlite3_create_module() |
| 5963 | 5977 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 5964 | 5978 | ** destructor. |
| 5965 | 5979 | */ |
| 5966 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module( | |
| 5980 | +SQLITE_API int SQLITE_APICALL sqlite3_create_module( | |
| 5967 | 5981 | sqlite3 *db, /* SQLite connection to register module with */ |
| 5968 | 5982 | const char *zName, /* Name of the module */ |
| 5969 | 5983 | const sqlite3_module *p, /* Methods for the module */ |
| 5970 | 5984 | void *pClientData /* Client data for xCreate/xConnect */ |
| 5971 | 5985 | ); |
| 5972 | -SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( | |
| 5986 | +SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2( | |
| 5973 | 5987 | sqlite3 *db, /* SQLite connection to register module with */ |
| 5974 | 5988 | const char *zName, /* Name of the module */ |
| 5975 | 5989 | const sqlite3_module *p, /* Methods for the module */ |
| 5976 | 5990 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 5977 | - void(*xDestroy)(void*) /* Module destructor function */ | |
| 5991 | + void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */ | |
| 5978 | 5992 | ); |
| 5979 | 5993 | |
| 5980 | 5994 | /* |
| 5981 | 5995 | ** CAPI3REF: Virtual Table Instance Object |
| 5982 | 5996 | ** KEYWORDS: sqlite3_vtab |
| @@ -6030,11 +6044,11 @@ | ||
| 6030 | 6044 | ** ^The [xCreate] and [xConnect] methods of a |
| 6031 | 6045 | ** [virtual table module] call this interface |
| 6032 | 6046 | ** to declare the format (the names and datatypes of the columns) of |
| 6033 | 6047 | ** the virtual tables they implement. |
| 6034 | 6048 | */ |
| 6035 | -SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); | |
| 6049 | +SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); | |
| 6036 | 6050 | |
| 6037 | 6051 | /* |
| 6038 | 6052 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6039 | 6053 | ** METHOD: sqlite3 |
| 6040 | 6054 | ** |
| @@ -6049,11 +6063,11 @@ | ||
| 6049 | 6063 | ** of the new function always causes an exception to be thrown. So |
| 6050 | 6064 | ** the new function is not good for anything by itself. Its only |
| 6051 | 6065 | ** purpose is to be a placeholder function that can be overloaded |
| 6052 | 6066 | ** by a [virtual table]. |
| 6053 | 6067 | */ |
| 6054 | -SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); | |
| 6068 | +SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); | |
| 6055 | 6069 | |
| 6056 | 6070 | /* |
| 6057 | 6071 | ** The interface to the virtual-table mechanism defined above (back up |
| 6058 | 6072 | ** to a comment remarkably similar to this one) is currently considered |
| 6059 | 6073 | ** to be experimental. The interface might change in incompatible ways. |
| @@ -6148,11 +6162,11 @@ | ||
| 6148 | 6162 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6149 | 6163 | ** |
| 6150 | 6164 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6151 | 6165 | ** be released by a call to [sqlite3_blob_close()]. |
| 6152 | 6166 | */ |
| 6153 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( | |
| 6167 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_open( | |
| 6154 | 6168 | sqlite3*, |
| 6155 | 6169 | const char *zDb, |
| 6156 | 6170 | const char *zTable, |
| 6157 | 6171 | const char *zColumn, |
| 6158 | 6172 | sqlite3_int64 iRow, |
| @@ -6181,11 +6195,11 @@ | ||
| 6181 | 6195 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6182 | 6196 | ** always returns zero. |
| 6183 | 6197 | ** |
| 6184 | 6198 | ** ^This function sets the database handle error code and message. |
| 6185 | 6199 | */ |
| 6186 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); | |
| 6200 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); | |
| 6187 | 6201 | |
| 6188 | 6202 | /* |
| 6189 | 6203 | ** CAPI3REF: Close A BLOB Handle |
| 6190 | 6204 | ** DESTRUCTOR: sqlite3_blob |
| 6191 | 6205 | ** |
| @@ -6204,11 +6218,11 @@ | ||
| 6204 | 6218 | ** with a null pointer (such as would be returned by a failed call to |
| 6205 | 6219 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6206 | 6220 | ** is passed a valid open blob handle, the values returned by the |
| 6207 | 6221 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6208 | 6222 | */ |
| 6209 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *); | |
| 6223 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *); | |
| 6210 | 6224 | |
| 6211 | 6225 | /* |
| 6212 | 6226 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6213 | 6227 | ** METHOD: sqlite3_blob |
| 6214 | 6228 | ** |
| @@ -6220,11 +6234,11 @@ | ||
| 6220 | 6234 | ** This routine only works on a [BLOB handle] which has been created |
| 6221 | 6235 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6222 | 6236 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6223 | 6237 | ** to this routine results in undefined and probably undesirable behavior. |
| 6224 | 6238 | */ |
| 6225 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *); | |
| 6239 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *); | |
| 6226 | 6240 | |
| 6227 | 6241 | /* |
| 6228 | 6242 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6229 | 6243 | ** METHOD: sqlite3_blob |
| 6230 | 6244 | ** |
| @@ -6249,11 +6263,11 @@ | ||
| 6249 | 6263 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6250 | 6264 | ** to this routine results in undefined and probably undesirable behavior. |
| 6251 | 6265 | ** |
| 6252 | 6266 | ** See also: [sqlite3_blob_write()]. |
| 6253 | 6267 | */ |
| 6254 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); | |
| 6268 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); | |
| 6255 | 6269 | |
| 6256 | 6270 | /* |
| 6257 | 6271 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6258 | 6272 | ** METHOD: sqlite3_blob |
| 6259 | 6273 | ** |
| @@ -6291,11 +6305,11 @@ | ||
| 6291 | 6305 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6292 | 6306 | ** to this routine results in undefined and probably undesirable behavior. |
| 6293 | 6307 | ** |
| 6294 | 6308 | ** See also: [sqlite3_blob_read()]. |
| 6295 | 6309 | */ |
| 6296 | -SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); | |
| 6310 | +SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); | |
| 6297 | 6311 | |
| 6298 | 6312 | /* |
| 6299 | 6313 | ** CAPI3REF: Virtual File System Objects |
| 6300 | 6314 | ** |
| 6301 | 6315 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| @@ -6322,13 +6336,13 @@ | ||
| 6322 | 6336 | ** |
| 6323 | 6337 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6324 | 6338 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6325 | 6339 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6326 | 6340 | */ |
| 6327 | -SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName); | |
| 6328 | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); | |
| 6329 | -SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*); | |
| 6341 | +SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName); | |
| 6342 | +SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); | |
| 6343 | +SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*); | |
| 6330 | 6344 | |
| 6331 | 6345 | /* |
| 6332 | 6346 | ** CAPI3REF: Mutexes |
| 6333 | 6347 | ** |
| 6334 | 6348 | ** The SQLite core uses these routines for thread |
| @@ -6440,15 +6454,15 @@ | ||
| 6440 | 6454 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6441 | 6455 | ** behave as no-ops. |
| 6442 | 6456 | ** |
| 6443 | 6457 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6444 | 6458 | */ |
| 6445 | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); | |
| 6446 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); | |
| 6447 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); | |
| 6448 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); | |
| 6449 | -SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*); | |
| 6459 | +SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int); | |
| 6460 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*); | |
| 6461 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*); | |
| 6462 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*); | |
| 6463 | +SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*); | |
| 6450 | 6464 | |
| 6451 | 6465 | /* |
| 6452 | 6466 | ** CAPI3REF: Mutex Methods Object |
| 6453 | 6467 | ** |
| 6454 | 6468 | ** An instance of this structure defines the low-level routines |
| @@ -6513,19 +6527,19 @@ | ||
| 6513 | 6527 | ** If xMutexInit fails in any way, it is expected to clean up after itself |
| 6514 | 6528 | ** prior to returning. |
| 6515 | 6529 | */ |
| 6516 | 6530 | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; |
| 6517 | 6531 | struct sqlite3_mutex_methods { |
| 6518 | - int (*xMutexInit)(void); | |
| 6519 | - int (*xMutexEnd)(void); | |
| 6520 | - sqlite3_mutex *(*xMutexAlloc)(int); | |
| 6521 | - void (*xMutexFree)(sqlite3_mutex *); | |
| 6522 | - void (*xMutexEnter)(sqlite3_mutex *); | |
| 6523 | - int (*xMutexTry)(sqlite3_mutex *); | |
| 6524 | - void (*xMutexLeave)(sqlite3_mutex *); | |
| 6525 | - int (*xMutexHeld)(sqlite3_mutex *); | |
| 6526 | - int (*xMutexNotheld)(sqlite3_mutex *); | |
| 6532 | + int (SQLITE_CALLBACK *xMutexInit)(void); | |
| 6533 | + int (SQLITE_CALLBACK *xMutexEnd)(void); | |
| 6534 | + sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int); | |
| 6535 | + void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *); | |
| 6536 | + void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *); | |
| 6537 | + int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *); | |
| 6538 | + void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *); | |
| 6539 | + int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *); | |
| 6540 | + int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *); | |
| 6527 | 6541 | }; |
| 6528 | 6542 | |
| 6529 | 6543 | /* |
| 6530 | 6544 | ** CAPI3REF: Mutex Verification Routines |
| 6531 | 6545 | ** |
| @@ -6554,12 +6568,12 @@ | ||
| 6554 | 6568 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6555 | 6569 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6556 | 6570 | ** interface should also return 1 when given a NULL pointer. |
| 6557 | 6571 | */ |
| 6558 | 6572 | #ifndef NDEBUG |
| 6559 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*); | |
| 6560 | -SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*); | |
| 6573 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*); | |
| 6574 | +SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*); | |
| 6561 | 6575 | #endif |
| 6562 | 6576 | |
| 6563 | 6577 | /* |
| 6564 | 6578 | ** CAPI3REF: Mutex Types |
| 6565 | 6579 | ** |
| @@ -6595,11 +6609,11 @@ | ||
| 6595 | 6609 | ** serializes access to the [database connection] given in the argument |
| 6596 | 6610 | ** when the [threading mode] is Serialized. |
| 6597 | 6611 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6598 | 6612 | ** routine returns a NULL pointer. |
| 6599 | 6613 | */ |
| 6600 | -SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*); | |
| 6614 | +SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*); | |
| 6601 | 6615 | |
| 6602 | 6616 | /* |
| 6603 | 6617 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6604 | 6618 | ** METHOD: sqlite3 |
| 6605 | 6619 | ** |
| @@ -6630,11 +6644,11 @@ | ||
| 6630 | 6644 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6631 | 6645 | ** xFileControl method. |
| 6632 | 6646 | ** |
| 6633 | 6647 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6634 | 6648 | */ |
| 6635 | -SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); | |
| 6649 | +SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); | |
| 6636 | 6650 | |
| 6637 | 6651 | /* |
| 6638 | 6652 | ** CAPI3REF: Testing Interface |
| 6639 | 6653 | ** |
| 6640 | 6654 | ** ^The sqlite3_test_control() interface is used to read out internal |
| @@ -6712,12 +6726,12 @@ | ||
| 6712 | 6726 | ** be represented by a 32-bit integer, then the values returned by |
| 6713 | 6727 | ** sqlite3_status() are undefined. |
| 6714 | 6728 | ** |
| 6715 | 6729 | ** See also: [sqlite3_db_status()] |
| 6716 | 6730 | */ |
| 6717 | -SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); | |
| 6718 | -SQLITE_API int SQLITE_STDCALL sqlite3_status64( | |
| 6731 | +SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); | |
| 6732 | +SQLITE_API int SQLITE_APICALL sqlite3_status64( | |
| 6719 | 6733 | int op, |
| 6720 | 6734 | sqlite3_int64 *pCurrent, |
| 6721 | 6735 | sqlite3_int64 *pHighwater, |
| 6722 | 6736 | int resetFlag |
| 6723 | 6737 | ); |
| @@ -6838,11 +6852,11 @@ | ||
| 6838 | 6852 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 6839 | 6853 | ** non-zero [error code] on failure. |
| 6840 | 6854 | ** |
| 6841 | 6855 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 6842 | 6856 | */ |
| 6843 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); | |
| 6857 | +SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); | |
| 6844 | 6858 | |
| 6845 | 6859 | /* |
| 6846 | 6860 | ** CAPI3REF: Status Parameters for database connections |
| 6847 | 6861 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 6848 | 6862 | ** |
| @@ -6981,11 +6995,11 @@ | ||
| 6981 | 6995 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 6982 | 6996 | ** interface call returns. |
| 6983 | 6997 | ** |
| 6984 | 6998 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 6985 | 6999 | */ |
| 6986 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); | |
| 7000 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); | |
| 6987 | 7001 | |
| 6988 | 7002 | /* |
| 6989 | 7003 | ** CAPI3REF: Status Parameters for prepared statements |
| 6990 | 7004 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 6991 | 7005 | ** |
| @@ -7217,22 +7231,22 @@ | ||
| 7217 | 7231 | */ |
| 7218 | 7232 | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; |
| 7219 | 7233 | struct sqlite3_pcache_methods2 { |
| 7220 | 7234 | int iVersion; |
| 7221 | 7235 | void *pArg; |
| 7222 | - int (*xInit)(void*); | |
| 7223 | - void (*xShutdown)(void*); | |
| 7224 | - sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); | |
| 7225 | - void (*xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7226 | - int (*xPagecount)(sqlite3_pcache*); | |
| 7227 | - sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7228 | - void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); | |
| 7229 | - void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, | |
| 7236 | + int (SQLITE_CALLBACK *xInit)(void*); | |
| 7237 | + void (SQLITE_CALLBACK *xShutdown)(void*); | |
| 7238 | + sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable); | |
| 7239 | + void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7240 | + int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); | |
| 7241 | + sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7242 | + void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); | |
| 7243 | + void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, | |
| 7230 | 7244 | unsigned oldKey, unsigned newKey); |
| 7231 | - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7232 | - void (*xDestroy)(sqlite3_pcache*); | |
| 7233 | - void (*xShrink)(sqlite3_pcache*); | |
| 7245 | + void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7246 | + void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); | |
| 7247 | + void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*); | |
| 7234 | 7248 | }; |
| 7235 | 7249 | |
| 7236 | 7250 | /* |
| 7237 | 7251 | ** This is the obsolete pcache_methods object that has now been replaced |
| 7238 | 7252 | ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is |
| @@ -7239,20 +7253,20 @@ | ||
| 7239 | 7253 | ** retained in the header file for backwards compatibility only. |
| 7240 | 7254 | */ |
| 7241 | 7255 | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; |
| 7242 | 7256 | struct sqlite3_pcache_methods { |
| 7243 | 7257 | void *pArg; |
| 7244 | - int (*xInit)(void*); | |
| 7245 | - void (*xShutdown)(void*); | |
| 7246 | - sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); | |
| 7247 | - void (*xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7248 | - int (*xPagecount)(sqlite3_pcache*); | |
| 7249 | - void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7250 | - void (*xUnpin)(sqlite3_pcache*, void*, int discard); | |
| 7251 | - void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); | |
| 7252 | - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7253 | - void (*xDestroy)(sqlite3_pcache*); | |
| 7258 | + int (SQLITE_CALLBACK *xInit)(void*); | |
| 7259 | + void (SQLITE_CALLBACK *xShutdown)(void*); | |
| 7260 | + sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable); | |
| 7261 | + void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); | |
| 7262 | + int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); | |
| 7263 | + void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); | |
| 7264 | + void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard); | |
| 7265 | + void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); | |
| 7266 | + void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); | |
| 7267 | + void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); | |
| 7254 | 7268 | }; |
| 7255 | 7269 | |
| 7256 | 7270 | |
| 7257 | 7271 | /* |
| 7258 | 7272 | ** CAPI3REF: Online Backup Object |
| @@ -7450,20 +7464,20 @@ | ||
| 7450 | 7464 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7451 | 7465 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7452 | 7466 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7453 | 7467 | ** possible that they return invalid values. |
| 7454 | 7468 | */ |
| 7455 | -SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( | |
| 7469 | +SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init( | |
| 7456 | 7470 | sqlite3 *pDest, /* Destination database handle */ |
| 7457 | 7471 | const char *zDestName, /* Destination database name */ |
| 7458 | 7472 | sqlite3 *pSource, /* Source database handle */ |
| 7459 | 7473 | const char *zSourceName /* Source database name */ |
| 7460 | 7474 | ); |
| 7461 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage); | |
| 7462 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p); | |
| 7463 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p); | |
| 7464 | -SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p); | |
| 7475 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage); | |
| 7476 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p); | |
| 7477 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p); | |
| 7478 | +SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p); | |
| 7465 | 7479 | |
| 7466 | 7480 | /* |
| 7467 | 7481 | ** CAPI3REF: Unlock Notification |
| 7468 | 7482 | ** METHOD: sqlite3 |
| 7469 | 7483 | ** |
| @@ -7576,13 +7590,13 @@ | ||
| 7576 | 7590 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7577 | 7591 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7578 | 7592 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7579 | 7593 | ** SQLITE_LOCKED.)^ |
| 7580 | 7594 | */ |
| 7581 | -SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( | |
| 7595 | +SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify( | |
| 7582 | 7596 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7583 | - void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ | |
| 7597 | + void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */ | |
| 7584 | 7598 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7585 | 7599 | ); |
| 7586 | 7600 | |
| 7587 | 7601 | |
| 7588 | 7602 | /* |
| @@ -7591,12 +7605,12 @@ | ||
| 7591 | 7605 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7592 | 7606 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7593 | 7607 | ** strings in a case-independent fashion, using the same definition of "case |
| 7594 | 7608 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7595 | 7609 | */ |
| 7596 | -SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *); | |
| 7597 | -SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int); | |
| 7610 | +SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *); | |
| 7611 | +SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int); | |
| 7598 | 7612 | |
| 7599 | 7613 | /* |
| 7600 | 7614 | ** CAPI3REF: String Globbing |
| 7601 | 7615 | * |
| 7602 | 7616 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| @@ -7609,11 +7623,11 @@ | ||
| 7609 | 7623 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7610 | 7624 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7611 | 7625 | ** |
| 7612 | 7626 | ** See also: [sqlite3_strlike()]. |
| 7613 | 7627 | */ |
| 7614 | -SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr); | |
| 7628 | +SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr); | |
| 7615 | 7629 | |
| 7616 | 7630 | /* |
| 7617 | 7631 | ** CAPI3REF: String LIKE Matching |
| 7618 | 7632 | * |
| 7619 | 7633 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| @@ -7632,11 +7646,11 @@ | ||
| 7632 | 7646 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7633 | 7647 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7634 | 7648 | ** |
| 7635 | 7649 | ** See also: [sqlite3_strglob()]. |
| 7636 | 7650 | */ |
| 7637 | -SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); | |
| 7651 | +SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); | |
| 7638 | 7652 | |
| 7639 | 7653 | /* |
| 7640 | 7654 | ** CAPI3REF: Error Logging Interface |
| 7641 | 7655 | ** |
| 7642 | 7656 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| @@ -7691,13 +7705,13 @@ | ||
| 7691 | 7705 | ** previously registered write-ahead log callback. ^Note that the |
| 7692 | 7706 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7693 | 7707 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7694 | 7708 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7695 | 7709 | */ |
| 7696 | -SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( | |
| 7710 | +SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook( | |
| 7697 | 7711 | sqlite3*, |
| 7698 | - int(*)(void *,sqlite3*,const char*,int), | |
| 7712 | + int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int), | |
| 7699 | 7713 | void* |
| 7700 | 7714 | ); |
| 7701 | 7715 | |
| 7702 | 7716 | /* |
| 7703 | 7717 | ** CAPI3REF: Configure an auto-checkpoint |
| @@ -7726,11 +7740,11 @@ | ||
| 7726 | 7740 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 7727 | 7741 | ** pages. The use of this interface |
| 7728 | 7742 | ** is only necessary if the default setting is found to be suboptimal |
| 7729 | 7743 | ** for a particular application. |
| 7730 | 7744 | */ |
| 7731 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); | |
| 7745 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); | |
| 7732 | 7746 | |
| 7733 | 7747 | /* |
| 7734 | 7748 | ** CAPI3REF: Checkpoint a database |
| 7735 | 7749 | ** METHOD: sqlite3 |
| 7736 | 7750 | ** |
| @@ -7748,11 +7762,11 @@ | ||
| 7748 | 7762 | ** interface was added. This interface is retained for backwards |
| 7749 | 7763 | ** compatibility and as a convenience for applications that need to manually |
| 7750 | 7764 | ** start a callback but which do not need the full power (and corresponding |
| 7751 | 7765 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 7752 | 7766 | */ |
| 7753 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); | |
| 7767 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); | |
| 7754 | 7768 | |
| 7755 | 7769 | /* |
| 7756 | 7770 | ** CAPI3REF: Checkpoint a database |
| 7757 | 7771 | ** METHOD: sqlite3 |
| 7758 | 7772 | ** |
| @@ -7842,11 +7856,11 @@ | ||
| 7842 | 7856 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 7843 | 7857 | ** |
| 7844 | 7858 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 7845 | 7859 | ** from SQL. |
| 7846 | 7860 | */ |
| 7847 | -SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( | |
| 7861 | +SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2( | |
| 7848 | 7862 | sqlite3 *db, /* Database handle */ |
| 7849 | 7863 | const char *zDb, /* Name of attached database (or NULL) */ |
| 7850 | 7864 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 7851 | 7865 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 7852 | 7866 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -7931,11 +7945,11 @@ | ||
| 7931 | 7945 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 7932 | 7946 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 7933 | 7947 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 7934 | 7948 | ** [virtual table]. |
| 7935 | 7949 | */ |
| 7936 | -SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *); | |
| 7950 | +SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *); | |
| 7937 | 7951 | |
| 7938 | 7952 | /* |
| 7939 | 7953 | ** CAPI3REF: Conflict resolution modes |
| 7940 | 7954 | ** KEYWORDS: {conflict resolution mode} |
| 7941 | 7955 | ** |
| @@ -8036,11 +8050,11 @@ | ||
| 8036 | 8050 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8037 | 8051 | ** that pOut points to unchanged. |
| 8038 | 8052 | ** |
| 8039 | 8053 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8040 | 8054 | */ |
| 8041 | -SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( | |
| 8055 | +SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus( | |
| 8042 | 8056 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8043 | 8057 | int idx, /* Index of loop to report on */ |
| 8044 | 8058 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8045 | 8059 | void *pOut /* Result written here */ |
| 8046 | 8060 | ); |
| @@ -8052,11 +8066,11 @@ | ||
| 8052 | 8066 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8053 | 8067 | ** |
| 8054 | 8068 | ** This API is only available if the library is built with pre-processor |
| 8055 | 8069 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8056 | 8070 | */ |
| 8057 | -SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); | |
| 8071 | +SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); | |
| 8058 | 8072 | |
| 8059 | 8073 | /* |
| 8060 | 8074 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8061 | 8075 | ** |
| 8062 | 8076 | ** ^If a write-transaction is open on [database connection] D when the |
| @@ -8084,11 +8098,11 @@ | ||
| 8084 | 8098 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8085 | 8099 | ** |
| 8086 | 8100 | ** ^This function does not set the database handle error code or message |
| 8087 | 8101 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8088 | 8102 | */ |
| 8089 | -SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*); | |
| 8103 | +SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*); | |
| 8090 | 8104 | |
| 8091 | 8105 | /* |
| 8092 | 8106 | ** CAPI3REF: The pre-update hook. |
| 8093 | 8107 | ** |
| 8094 | 8108 | ** ^These interfaces are only available if SQLite is compiled using the |
| @@ -8164,13 +8178,13 @@ | ||
| 8164 | 8178 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8165 | 8179 | ** triggers; and so forth. |
| 8166 | 8180 | ** |
| 8167 | 8181 | ** See also: [sqlite3_update_hook()] |
| 8168 | 8182 | */ |
| 8169 | -SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook( | |
| 8183 | +SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook( | |
| 8170 | 8184 | sqlite3 *db, |
| 8171 | - void(*xPreUpdate)( | |
| 8185 | + void(SQLITE_CALLBACK *xPreUpdate)( | |
| 8172 | 8186 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8173 | 8187 | sqlite3 *db, /* Database handle */ |
| 8174 | 8188 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| 8175 | 8189 | char const *zDb, /* Database name */ |
| 8176 | 8190 | char const *zName, /* Table name */ |
| @@ -8177,14 +8191,14 @@ | ||
| 8177 | 8191 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8178 | 8192 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8179 | 8193 | ), |
| 8180 | 8194 | void* |
| 8181 | 8195 | ); |
| 8182 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); | |
| 8183 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *); | |
| 8184 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *); | |
| 8185 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); | |
| 8196 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); | |
| 8197 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *); | |
| 8198 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *); | |
| 8199 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); | |
| 8186 | 8200 | |
| 8187 | 8201 | /* |
| 8188 | 8202 | ** CAPI3REF: Low-level system error code |
| 8189 | 8203 | ** |
| 8190 | 8204 | ** ^Attempt to return the underlying operating system error code or error |
| @@ -8192,11 +8206,11 @@ | ||
| 8192 | 8206 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8193 | 8207 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8194 | 8208 | ** called to get back the underlying "errno" that caused the problem, such |
| 8195 | 8209 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8196 | 8210 | */ |
| 8197 | -SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*); | |
| 8211 | +SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*); | |
| 8198 | 8212 | |
| 8199 | 8213 | /* |
| 8200 | 8214 | ** CAPI3REF: Database Snapshot |
| 8201 | 8215 | ** KEYWORDS: {snapshot} |
| 8202 | 8216 | ** EXPERIMENTAL |
| @@ -8242,11 +8256,11 @@ | ||
| 8242 | 8256 | ** to avoid a memory leak. |
| 8243 | 8257 | ** |
| 8244 | 8258 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8245 | 8259 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8246 | 8260 | */ |
| 8247 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get( | |
| 8261 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get( | |
| 8248 | 8262 | sqlite3 *db, |
| 8249 | 8263 | const char *zSchema, |
| 8250 | 8264 | sqlite3_snapshot **ppSnapshot |
| 8251 | 8265 | ); |
| 8252 | 8266 | |
| @@ -8280,11 +8294,11 @@ | ||
| 8280 | 8294 | ** database connection in order to make it ready to use snapshots.) |
| 8281 | 8295 | ** |
| 8282 | 8296 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8283 | 8297 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8284 | 8298 | */ |
| 8285 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open( | |
| 8299 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open( | |
| 8286 | 8300 | sqlite3 *db, |
| 8287 | 8301 | const char *zSchema, |
| 8288 | 8302 | sqlite3_snapshot *pSnapshot |
| 8289 | 8303 | ); |
| 8290 | 8304 | |
| @@ -8297,11 +8311,11 @@ | ||
| 8297 | 8311 | ** using this routine to avoid a memory leak. |
| 8298 | 8312 | ** |
| 8299 | 8313 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8300 | 8314 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8301 | 8315 | */ |
| 8302 | -SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*); | |
| 8316 | +SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*); | |
| 8303 | 8317 | |
| 8304 | 8318 | /* |
| 8305 | 8319 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8306 | 8320 | ** EXPERIMENTAL |
| 8307 | 8321 | ** |
| @@ -8321,11 +8335,11 @@ | ||
| 8321 | 8335 | ** |
| 8322 | 8336 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8323 | 8337 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8324 | 8338 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8325 | 8339 | */ |
| 8326 | -SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp( | |
| 8340 | +SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp( | |
| 8327 | 8341 | sqlite3_snapshot *p1, |
| 8328 | 8342 | sqlite3_snapshot *p2 |
| 8329 | 8343 | ); |
| 8330 | 8344 | |
| 8331 | 8345 | /* |
| @@ -8379,14 +8393,14 @@ | ||
| 8379 | 8393 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8380 | 8394 | ** R-Tree geometry query as follows: |
| 8381 | 8395 | ** |
| 8382 | 8396 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8383 | 8397 | */ |
| 8384 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( | |
| 8398 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback( | |
| 8385 | 8399 | sqlite3 *db, |
| 8386 | 8400 | const char *zGeom, |
| 8387 | - int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), | |
| 8401 | + int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), | |
| 8388 | 8402 | void *pContext |
| 8389 | 8403 | ); |
| 8390 | 8404 | |
| 8391 | 8405 | |
| 8392 | 8406 | /* |
| @@ -8396,25 +8410,25 @@ | ||
| 8396 | 8410 | struct sqlite3_rtree_geometry { |
| 8397 | 8411 | void *pContext; /* Copy of pContext passed to s_r_g_c() */ |
| 8398 | 8412 | int nParam; /* Size of array aParam[] */ |
| 8399 | 8413 | sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ |
| 8400 | 8414 | void *pUser; /* Callback implementation user data */ |
| 8401 | - void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ | |
| 8415 | + void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */ | |
| 8402 | 8416 | }; |
| 8403 | 8417 | |
| 8404 | 8418 | /* |
| 8405 | 8419 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8406 | 8420 | ** used as part of an R-Tree geometry query as follows: |
| 8407 | 8421 | ** |
| 8408 | 8422 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8409 | 8423 | */ |
| 8410 | -SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( | |
| 8424 | +SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback( | |
| 8411 | 8425 | sqlite3 *db, |
| 8412 | 8426 | const char *zQueryFunc, |
| 8413 | - int (*xQueryFunc)(sqlite3_rtree_query_info*), | |
| 8427 | + int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*), | |
| 8414 | 8428 | void *pContext, |
| 8415 | - void (*xDestructor)(void*) | |
| 8429 | + void (SQLITE_CALLBACK *xDestructor)(void*) | |
| 8416 | 8430 | ); |
| 8417 | 8431 | |
| 8418 | 8432 | |
| 8419 | 8433 | /* |
| 8420 | 8434 | ** A pointer to a structure of the following type is passed as the |
| @@ -8428,11 +8442,11 @@ | ||
| 8428 | 8442 | struct sqlite3_rtree_query_info { |
| 8429 | 8443 | void *pContext; /* pContext from when function registered */ |
| 8430 | 8444 | int nParam; /* Number of function parameters */ |
| 8431 | 8445 | sqlite3_rtree_dbl *aParam; /* value of function parameters */ |
| 8432 | 8446 | void *pUser; /* callback can use this, if desired */ |
| 8433 | - void (*xDelUser)(void*); /* function to free pUser */ | |
| 8447 | + void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */ | |
| 8434 | 8448 | sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ |
| 8435 | 8449 | unsigned int *anQueue; /* Number of pending entries in the queue */ |
| 8436 | 8450 | int nCoord; /* Number of coordinates */ |
| 8437 | 8451 | int iLevel; /* Level of current node or entry */ |
| 8438 | 8452 | int mxLevel; /* The largest iLevel value in the tree */ |
| @@ -8624,11 +8638,11 @@ | ||
| 8624 | 8638 | ** If xFilter returns 0, changes is not tracked. Note that once a table is |
| 8625 | 8639 | ** attached, xFilter will not be called again. |
| 8626 | 8640 | */ |
| 8627 | 8641 | void sqlite3session_table_filter( |
| 8628 | 8642 | sqlite3_session *pSession, /* Session object */ |
| 8629 | - int(*xFilter)( | |
| 8643 | + int(SQLITE_CALLBACK *xFilter)( | |
| 8630 | 8644 | void *pCtx, /* Copy of third arg to _filter_table() */ |
| 8631 | 8645 | const char *zTab /* Table name */ |
| 8632 | 8646 | ), |
| 8633 | 8647 | void *pCtx /* First argument passed to xFilter */ |
| 8634 | 8648 | ); |
| @@ -9199,11 +9213,11 @@ | ||
| 9199 | 9213 | ** An sqlite3_changegroup object is used to combine two or more changesets |
| 9200 | 9214 | ** (or patchsets) into a single changeset (or patchset). A single changegroup |
| 9201 | 9215 | ** object may combine changesets or patchsets, but not both. The output is |
| 9202 | 9216 | ** always in the same format as the input. |
| 9203 | 9217 | ** |
| 9204 | -** If successful, this function returns SQLITE_OK and populates (*pp) with | |
| 9218 | +** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with | |
| 9205 | 9219 | ** a pointer to a new sqlite3_changegroup object before returning. The caller |
| 9206 | 9220 | ** should eventually free the returned object using a call to |
| 9207 | 9221 | ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code |
| 9208 | 9222 | ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. |
| 9209 | 9223 | ** |
| @@ -9319,11 +9333,11 @@ | ||
| 9319 | 9333 | ** changes for tables that do not appear in the first changeset, they are |
| 9320 | 9334 | ** appended onto the end of the output changeset, again in the order in |
| 9321 | 9335 | ** which they are first encountered. |
| 9322 | 9336 | ** |
| 9323 | 9337 | ** If an error occurs, an SQLite error code is returned and the output |
| 9324 | -** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK | |
| 9338 | +** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK | |
| 9325 | 9339 | ** is returned and the output variables are set to the size of and a |
| 9326 | 9340 | ** pointer to the output buffer, respectively. In this case it is the |
| 9327 | 9341 | ** responsibility of the caller to eventually free the buffer using a |
| 9328 | 9342 | ** call to sqlite3_free(). |
| 9329 | 9343 | */ |
| @@ -9476,15 +9490,15 @@ | ||
| 9476 | 9490 | */ |
| 9477 | 9491 | int sqlite3changeset_apply( |
| 9478 | 9492 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9479 | 9493 | int nChangeset, /* Size of changeset in bytes */ |
| 9480 | 9494 | void *pChangeset, /* Changeset blob */ |
| 9481 | - int(*xFilter)( | |
| 9495 | + int(SQLITE_CALLBACK *xFilter)( | |
| 9482 | 9496 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9483 | 9497 | const char *zTab /* Table name */ |
| 9484 | 9498 | ), |
| 9485 | - int(*xConflict)( | |
| 9499 | + int(SQLITE_CALLBACK *xConflict)( | |
| 9486 | 9500 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9487 | 9501 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9488 | 9502 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9489 | 9503 | ), |
| 9490 | 9504 | void *pCtx /* First argument passed to xConflict */ |
| @@ -9621,20 +9635,20 @@ | ||
| 9621 | 9635 | ** </pre> |
| 9622 | 9636 | ** |
| 9623 | 9637 | ** Is replaced by: |
| 9624 | 9638 | ** |
| 9625 | 9639 | ** <pre> |
| 9626 | -** int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9640 | +** int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9627 | 9641 | ** void *pIn, |
| 9628 | 9642 | ** </pre> |
| 9629 | 9643 | ** |
| 9630 | 9644 | ** Each time the xInput callback is invoked by the sessions module, the first |
| 9631 | 9645 | ** argument passed is a copy of the supplied pIn context pointer. The second |
| 9632 | -** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no | |
| 9633 | -** error occurs the xInput method should copy up to (*pnData) bytes of data | |
| 9634 | -** into the buffer and set (*pnData) to the actual number of bytes copied | |
| 9635 | -** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) | |
| 9646 | +** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no | |
| 9647 | +** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data | |
| 9648 | +** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied | |
| 9649 | +** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData) | |
| 9636 | 9650 | ** should be set to zero to indicate this. Or, if an error occurs, an SQLite |
| 9637 | 9651 | ** error code should be returned. In all cases, if an xInput callback returns |
| 9638 | 9652 | ** an error, all processing is abandoned and the streaming API function |
| 9639 | 9653 | ** returns a copy of the error code to the caller. |
| 9640 | 9654 | ** |
| @@ -9655,11 +9669,11 @@ | ||
| 9655 | 9669 | ** </pre> |
| 9656 | 9670 | ** |
| 9657 | 9671 | ** Is replaced by: |
| 9658 | 9672 | ** |
| 9659 | 9673 | ** <pre> |
| 9660 | -** int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9674 | +** int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9661 | 9675 | ** void *pOut |
| 9662 | 9676 | ** </pre> |
| 9663 | 9677 | ** |
| 9664 | 9678 | ** The xOutput callback is invoked zero or more times to return data to |
| 9665 | 9679 | ** the application. The first parameter passed to each call is a copy of the |
| @@ -9675,58 +9689,58 @@ | ||
| 9675 | 9689 | ** parameter set to a value less than or equal to zero. Other than this, |
| 9676 | 9690 | ** no guarantees are made as to the size of the chunks of data returned. |
| 9677 | 9691 | */ |
| 9678 | 9692 | int sqlite3changeset_apply_strm( |
| 9679 | 9693 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9680 | - int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ | |
| 9694 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */ | |
| 9681 | 9695 | void *pIn, /* First arg for xInput */ |
| 9682 | - int(*xFilter)( | |
| 9696 | + int(SQLITE_CALLBACK *xFilter)( | |
| 9683 | 9697 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9684 | 9698 | const char *zTab /* Table name */ |
| 9685 | 9699 | ), |
| 9686 | - int(*xConflict)( | |
| 9700 | + int(SQLITE_CALLBACK *xConflict)( | |
| 9687 | 9701 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9688 | 9702 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9689 | 9703 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9690 | 9704 | ), |
| 9691 | 9705 | void *pCtx /* First argument passed to xConflict */ |
| 9692 | 9706 | ); |
| 9693 | 9707 | int sqlite3changeset_concat_strm( |
| 9694 | - int (*xInputA)(void *pIn, void *pData, int *pnData), | |
| 9708 | + int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData), | |
| 9695 | 9709 | void *pInA, |
| 9696 | - int (*xInputB)(void *pIn, void *pData, int *pnData), | |
| 9710 | + int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData), | |
| 9697 | 9711 | void *pInB, |
| 9698 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9712 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9699 | 9713 | void *pOut |
| 9700 | 9714 | ); |
| 9701 | 9715 | int sqlite3changeset_invert_strm( |
| 9702 | - int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9716 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9703 | 9717 | void *pIn, |
| 9704 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9718 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9705 | 9719 | void *pOut |
| 9706 | 9720 | ); |
| 9707 | 9721 | int sqlite3changeset_start_strm( |
| 9708 | 9722 | sqlite3_changeset_iter **pp, |
| 9709 | - int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9723 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9710 | 9724 | void *pIn |
| 9711 | 9725 | ); |
| 9712 | 9726 | int sqlite3session_changeset_strm( |
| 9713 | 9727 | sqlite3_session *pSession, |
| 9714 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9728 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9715 | 9729 | void *pOut |
| 9716 | 9730 | ); |
| 9717 | 9731 | int sqlite3session_patchset_strm( |
| 9718 | 9732 | sqlite3_session *pSession, |
| 9719 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9733 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9720 | 9734 | void *pOut |
| 9721 | 9735 | ); |
| 9722 | 9736 | int sqlite3changegroup_add_strm(sqlite3_changegroup*, |
| 9723 | - int (*xInput)(void *pIn, void *pData, int *pnData), | |
| 9737 | + int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), | |
| 9724 | 9738 | void *pIn |
| 9725 | 9739 | ); |
| 9726 | 9740 | int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 9727 | - int (*xOutput)(void *pOut, const void *pData, int nData), | |
| 9741 | + int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), | |
| 9728 | 9742 | void *pOut |
| 9729 | 9743 | ); |
| 9730 | 9744 | |
| 9731 | 9745 | |
| 9732 | 9746 | /* |
| @@ -9777,11 +9791,11 @@ | ||
| 9777 | 9791 | |
| 9778 | 9792 | typedef struct Fts5ExtensionApi Fts5ExtensionApi; |
| 9779 | 9793 | typedef struct Fts5Context Fts5Context; |
| 9780 | 9794 | typedef struct Fts5PhraseIter Fts5PhraseIter; |
| 9781 | 9795 | |
| 9782 | -typedef void (*fts5_extension_function)( | |
| 9796 | +typedef void (SQLITE_CALLBACK *fts5_extension_function)( | |
| 9783 | 9797 | const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ |
| 9784 | 9798 | Fts5Context *pFts, /* First arg to pass to pApi functions */ |
| 9785 | 9799 | sqlite3_context *pCtx, /* Context for returning result/error */ |
| 9786 | 9800 | int nVal, /* Number of values in apVal[] array */ |
| 9787 | 9801 | sqlite3_value **apVal /* Array of trailing arguments */ |
| @@ -9828,15 +9842,15 @@ | ||
| 9828 | 9842 | ** This function may be quite inefficient if used with an FTS5 table |
| 9829 | 9843 | ** created with the "columnsize=0" option. |
| 9830 | 9844 | ** |
| 9831 | 9845 | ** xColumnText: |
| 9832 | 9846 | ** This function attempts to retrieve the text of column iCol of the |
| 9833 | -** current document. If successful, (*pz) is set to point to a buffer | |
| 9834 | -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes | |
| 9847 | +** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer | |
| 9848 | +** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes | |
| 9835 | 9849 | ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, |
| 9836 | 9850 | ** if an error occurs, an SQLite error code is returned and the final values |
| 9837 | -** of (*pz) and (*pn) are undefined. | |
| 9851 | +** of (SQLITE_CALLBACK *pz) and (*pn) are undefined. | |
| 9838 | 9852 | ** |
| 9839 | 9853 | ** xPhraseCount: |
| 9840 | 9854 | ** Returns the number of phrases in the current query expression. |
| 9841 | 9855 | ** |
| 9842 | 9856 | ** xPhraseSize: |
| @@ -9941,11 +9955,11 @@ | ||
| 9941 | 9955 | ** xRowCount(pFts5, pnRow) |
| 9942 | 9956 | ** |
| 9943 | 9957 | ** This function is used to retrieve the total number of rows in the table. |
| 9944 | 9958 | ** In other words, the same value that would be returned by: |
| 9945 | 9959 | ** |
| 9946 | -** SELECT count(*) FROM ftstable; | |
| 9960 | +** SELECT count(SQLITE_CALLBACK *) FROM ftstable; | |
| 9947 | 9961 | ** |
| 9948 | 9962 | ** xPhraseFirst() |
| 9949 | 9963 | ** This function is used, along with type Fts5PhraseIter and the xPhraseNext |
| 9950 | 9964 | ** method, to iterate through all instances of a single query phrase within |
| 9951 | 9965 | ** the current row. This is the same information as is accessible via the |
| @@ -10008,43 +10022,43 @@ | ||
| 10008 | 10022 | ** See xPhraseFirstColumn above. |
| 10009 | 10023 | */ |
| 10010 | 10024 | struct Fts5ExtensionApi { |
| 10011 | 10025 | int iVersion; /* Currently always set to 3 */ |
| 10012 | 10026 | |
| 10013 | - void *(*xUserData)(Fts5Context*); | |
| 10027 | + void *(SQLITE_CALLBACK *xUserData)(Fts5Context*); | |
| 10014 | 10028 | |
| 10015 | - int (*xColumnCount)(Fts5Context*); | |
| 10016 | - int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); | |
| 10017 | - int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); | |
| 10029 | + int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*); | |
| 10030 | + int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); | |
| 10031 | + int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); | |
| 10018 | 10032 | |
| 10019 | - int (*xTokenize)(Fts5Context*, | |
| 10033 | + int (SQLITE_CALLBACK *xTokenize)(Fts5Context*, | |
| 10020 | 10034 | const char *pText, int nText, /* Text to tokenize */ |
| 10021 | 10035 | void *pCtx, /* Context passed to xToken() */ |
| 10022 | - int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ | |
| 10023 | - ); | |
| 10024 | - | |
| 10025 | - int (*xPhraseCount)(Fts5Context*); | |
| 10026 | - int (*xPhraseSize)(Fts5Context*, int iPhrase); | |
| 10027 | - | |
| 10028 | - int (*xInstCount)(Fts5Context*, int *pnInst); | |
| 10029 | - int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); | |
| 10030 | - | |
| 10031 | - sqlite3_int64 (*xRowid)(Fts5Context*); | |
| 10032 | - int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); | |
| 10033 | - int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); | |
| 10034 | - | |
| 10035 | - int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, | |
| 10036 | - int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) | |
| 10037 | - ); | |
| 10038 | - int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); | |
| 10039 | - void *(*xGetAuxdata)(Fts5Context*, int bClear); | |
| 10040 | - | |
| 10041 | - int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); | |
| 10042 | - void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); | |
| 10043 | - | |
| 10044 | - int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); | |
| 10045 | - void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); | |
| 10036 | + int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */ | |
| 10037 | + ); | |
| 10038 | + | |
| 10039 | + int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*); | |
| 10040 | + int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase); | |
| 10041 | + | |
| 10042 | + int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst); | |
| 10043 | + int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); | |
| 10044 | + | |
| 10045 | + sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*); | |
| 10046 | + int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); | |
| 10047 | + int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken); | |
| 10048 | + | |
| 10049 | + int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, | |
| 10050 | + int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*) | |
| 10051 | + ); | |
| 10052 | + int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); | |
| 10053 | + void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear); | |
| 10054 | + | |
| 10055 | + int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); | |
| 10056 | + void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); | |
| 10057 | + | |
| 10058 | + int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); | |
| 10059 | + void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); | |
| 10046 | 10060 | }; |
| 10047 | 10061 | |
| 10048 | 10062 | /* |
| 10049 | 10063 | ** CUSTOM AUXILIARY FUNCTIONS |
| 10050 | 10064 | *************************************************************************/ |
| @@ -10068,11 +10082,11 @@ | ||
| 10068 | 10082 | ** The second and third arguments are an array of nul-terminated strings |
| 10069 | 10083 | ** containing the tokenizer arguments, if any, specified following the |
| 10070 | 10084 | ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used |
| 10071 | 10085 | ** to create the FTS5 table. |
| 10072 | 10086 | ** |
| 10073 | -** The final argument is an output variable. If successful, (*ppOut) | |
| 10087 | +** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut) | |
| 10074 | 10088 | ** should be set to point to the new tokenizer handle and SQLITE_OK |
| 10075 | 10089 | ** returned. If an error occurs, some value other than SQLITE_OK should |
| 10076 | 10090 | ** be returned. In this case, fts5 assumes that the final value of *ppOut |
| 10077 | 10091 | ** is undefined. |
| 10078 | 10092 | ** |
| @@ -10242,17 +10256,17 @@ | ||
| 10242 | 10256 | ** inefficient. |
| 10243 | 10257 | */ |
| 10244 | 10258 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| 10245 | 10259 | typedef struct fts5_tokenizer fts5_tokenizer; |
| 10246 | 10260 | struct fts5_tokenizer { |
| 10247 | - int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); | |
| 10248 | - void (*xDelete)(Fts5Tokenizer*); | |
| 10249 | - int (*xTokenize)(Fts5Tokenizer*, | |
| 10261 | + int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); | |
| 10262 | + void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*); | |
| 10263 | + int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*, | |
| 10250 | 10264 | void *pCtx, |
| 10251 | 10265 | int flags, /* Mask of FTS5_TOKENIZE_* flags */ |
| 10252 | 10266 | const char *pText, int nText, |
| 10253 | - int (*xToken)( | |
| 10267 | + int (SQLITE_CALLBACK *xToken)( | |
| 10254 | 10268 | void *pCtx, /* Copy of 2nd argument to xTokenize() */ |
| 10255 | 10269 | int tflags, /* Mask of FTS5_TOKEN_* flags */ |
| 10256 | 10270 | const char *pToken, /* Pointer to buffer containing token */ |
| 10257 | 10271 | int nToken, /* Size of token in bytes */ |
| 10258 | 10272 | int iStart, /* Byte offset of token within input text */ |
| @@ -10281,33 +10295,33 @@ | ||
| 10281 | 10295 | typedef struct fts5_api fts5_api; |
| 10282 | 10296 | struct fts5_api { |
| 10283 | 10297 | int iVersion; /* Currently always set to 2 */ |
| 10284 | 10298 | |
| 10285 | 10299 | /* Create a new tokenizer */ |
| 10286 | - int (*xCreateTokenizer)( | |
| 10300 | + int (SQLITE_CALLBACK *xCreateTokenizer)( | |
| 10287 | 10301 | fts5_api *pApi, |
| 10288 | 10302 | const char *zName, |
| 10289 | 10303 | void *pContext, |
| 10290 | 10304 | fts5_tokenizer *pTokenizer, |
| 10291 | - void (*xDestroy)(void*) | |
| 10305 | + void (SQLITE_CALLBACK *xDestroy)(void*) | |
| 10292 | 10306 | ); |
| 10293 | 10307 | |
| 10294 | 10308 | /* Find an existing tokenizer */ |
| 10295 | - int (*xFindTokenizer)( | |
| 10309 | + int (SQLITE_CALLBACK *xFindTokenizer)( | |
| 10296 | 10310 | fts5_api *pApi, |
| 10297 | 10311 | const char *zName, |
| 10298 | 10312 | void **ppContext, |
| 10299 | 10313 | fts5_tokenizer *pTokenizer |
| 10300 | 10314 | ); |
| 10301 | 10315 | |
| 10302 | 10316 | /* Create a new auxiliary function */ |
| 10303 | - int (*xCreateFunction)( | |
| 10317 | + int (SQLITE_CALLBACK *xCreateFunction)( | |
| 10304 | 10318 | fts5_api *pApi, |
| 10305 | 10319 | const char *zName, |
| 10306 | 10320 | void *pContext, |
| 10307 | 10321 | fts5_extension_function xFunction, |
| 10308 | - void (*xDestroy)(void*) | |
| 10322 | + void (SQLITE_CALLBACK *xDestroy)(void*) | |
| 10309 | 10323 | ); |
| 10310 | 10324 | }; |
| 10311 | 10325 | |
| 10312 | 10326 | /* |
| 10313 | 10327 | ** END OF REGISTRATION API |
| 10314 | 10328 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -52,12 +52,21 @@ | |
| 52 | # define SQLITE_API |
| 53 | #endif |
| 54 | #ifndef SQLITE_CDECL |
| 55 | # define SQLITE_CDECL |
| 56 | #endif |
| 57 | #ifndef SQLITE_STDCALL |
| 58 | # define SQLITE_STDCALL |
| 59 | #endif |
| 60 | |
| 61 | /* |
| 62 | ** These no-op macros are used in front of interfaces to mark those |
| 63 | ** interfaces as either deprecated or experimental. New applications |
| @@ -111,11 +120,11 @@ | |
| 111 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 112 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 113 | */ |
| 114 | #define SQLITE_VERSION "3.14.0" |
| 115 | #define SQLITE_VERSION_NUMBER 3014000 |
| 116 | #define SQLITE_SOURCE_ID "2016-07-28 12:52:30 6feff15cae8f0427be790355841d49c479c1c586" |
| 117 | |
| 118 | /* |
| 119 | ** CAPI3REF: Run-Time Library Version Numbers |
| 120 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 121 | ** |
| @@ -144,13 +153,13 @@ | |
| 144 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 145 | ** |
| 146 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 147 | */ |
| 148 | SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; |
| 149 | SQLITE_API const char *SQLITE_STDCALL sqlite3_libversion(void); |
| 150 | SQLITE_API const char *SQLITE_STDCALL sqlite3_sourceid(void); |
| 151 | SQLITE_API int SQLITE_STDCALL sqlite3_libversion_number(void); |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 155 | ** |
| 156 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| @@ -171,12 +180,12 @@ | |
| 171 | ** |
| 172 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 173 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 174 | */ |
| 175 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 176 | SQLITE_API int SQLITE_STDCALL sqlite3_compileoption_used(const char *zOptName); |
| 177 | SQLITE_API const char *SQLITE_STDCALL sqlite3_compileoption_get(int N); |
| 178 | #endif |
| 179 | |
| 180 | /* |
| 181 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 182 | ** |
| @@ -211,11 +220,11 @@ | |
| 211 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 212 | ** is unchanged by calls to sqlite3_config().)^ |
| 213 | ** |
| 214 | ** See the [threading mode] documentation for additional information. |
| 215 | */ |
| 216 | SQLITE_API int SQLITE_STDCALL sqlite3_threadsafe(void); |
| 217 | |
| 218 | /* |
| 219 | ** CAPI3REF: Database Connection Handle |
| 220 | ** KEYWORDS: {database connection} {database connections} |
| 221 | ** |
| @@ -308,19 +317,19 @@ | |
| 308 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 309 | ** [sqlite3_open_v2()], and not previously closed. |
| 310 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 311 | ** argument is a harmless no-op. |
| 312 | */ |
| 313 | SQLITE_API int SQLITE_STDCALL sqlite3_close(sqlite3*); |
| 314 | SQLITE_API int SQLITE_STDCALL sqlite3_close_v2(sqlite3*); |
| 315 | |
| 316 | /* |
| 317 | ** The type for a callback function. |
| 318 | ** This is legacy and deprecated. It is included for historical |
| 319 | ** compatibility and is not documented. |
| 320 | */ |
| 321 | typedef int (*sqlite3_callback)(void*,int,char**, char**); |
| 322 | |
| 323 | /* |
| 324 | ** CAPI3REF: One-Step Query Execution Interface |
| 325 | ** METHOD: sqlite3 |
| 326 | ** |
| @@ -380,14 +389,14 @@ | |
| 380 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 381 | ** <li> The application must not modify the SQL statement text passed into |
| 382 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 383 | ** </ul> |
| 384 | */ |
| 385 | SQLITE_API int SQLITE_STDCALL sqlite3_exec( |
| 386 | sqlite3*, /* An open database */ |
| 387 | const char *sql, /* SQL to be evaluated */ |
| 388 | int (*callback)(void*,int,char**,char**), /* Callback function */ |
| 389 | void *, /* 1st argument to callback */ |
| 390 | char **errmsg /* Error msg written here */ |
| 391 | ); |
| 392 | |
| 393 | /* |
| @@ -731,30 +740,30 @@ | |
| 731 | ** database corruption. |
| 732 | */ |
| 733 | typedef struct sqlite3_io_methods sqlite3_io_methods; |
| 734 | struct sqlite3_io_methods { |
| 735 | int iVersion; |
| 736 | int (*xClose)(sqlite3_file*); |
| 737 | int (*xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); |
| 738 | int (*xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); |
| 739 | int (*xTruncate)(sqlite3_file*, sqlite3_int64 size); |
| 740 | int (*xSync)(sqlite3_file*, int flags); |
| 741 | int (*xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); |
| 742 | int (*xLock)(sqlite3_file*, int); |
| 743 | int (*xUnlock)(sqlite3_file*, int); |
| 744 | int (*xCheckReservedLock)(sqlite3_file*, int *pResOut); |
| 745 | int (*xFileControl)(sqlite3_file*, int op, void *pArg); |
| 746 | int (*xSectorSize)(sqlite3_file*); |
| 747 | int (*xDeviceCharacteristics)(sqlite3_file*); |
| 748 | /* Methods above are valid for version 1 */ |
| 749 | int (*xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); |
| 750 | int (*xShmLock)(sqlite3_file*, int offset, int n, int flags); |
| 751 | void (*xShmBarrier)(sqlite3_file*); |
| 752 | int (*xShmUnmap)(sqlite3_file*, int deleteFlag); |
| 753 | /* Methods above are valid for version 2 */ |
| 754 | int (*xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); |
| 755 | int (*xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); |
| 756 | /* Methods above are valid for version 3 */ |
| 757 | /* Additional methods may be added in future releases */ |
| 758 | }; |
| 759 | |
| 760 | /* |
| @@ -926,11 +935,11 @@ | |
| 926 | ** ^The [SQLITE_FCNTL_BUSYHANDLER] |
| 927 | ** file-control may be invoked by SQLite on the database file handle |
| 928 | ** shortly after it is opened in order to provide a custom VFS with access |
| 929 | ** to the connections busy-handler callback. The argument is of type (void **) |
| 930 | ** - an array of two (void *) values. The first (void *) actually points |
| 931 | ** to a function of type (int (*)(void *)). In order to invoke the connections |
| 932 | ** busy-handler, this function should be invoked with the second (void *) in |
| 933 | ** the array as the only argument. If it returns non-zero, then the operation |
| 934 | ** should be retried. If it returns zero, the custom VFS should abandon the |
| 935 | ** current operation. |
| 936 | ** |
| @@ -1192,43 +1201,43 @@ | |
| 1192 | ** or all of these interfaces to be NULL or for their behavior to change |
| 1193 | ** from one release to the next. Applications must not attempt to access |
| 1194 | ** any of these methods if the iVersion of the VFS is less than 3. |
| 1195 | */ |
| 1196 | typedef struct sqlite3_vfs sqlite3_vfs; |
| 1197 | typedef void (*sqlite3_syscall_ptr)(void); |
| 1198 | struct sqlite3_vfs { |
| 1199 | int iVersion; /* Structure version number (currently 3) */ |
| 1200 | int szOsFile; /* Size of subclassed sqlite3_file */ |
| 1201 | int mxPathname; /* Maximum file pathname length */ |
| 1202 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1203 | const char *zName; /* Name of this virtual file system */ |
| 1204 | void *pAppData; /* Pointer to application-specific data */ |
| 1205 | int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, |
| 1206 | int flags, int *pOutFlags); |
| 1207 | int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); |
| 1208 | int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); |
| 1209 | int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); |
| 1210 | void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); |
| 1211 | void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); |
| 1212 | void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); |
| 1213 | void (*xDlClose)(sqlite3_vfs*, void*); |
| 1214 | int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); |
| 1215 | int (*xSleep)(sqlite3_vfs*, int microseconds); |
| 1216 | int (*xCurrentTime)(sqlite3_vfs*, double*); |
| 1217 | int (*xGetLastError)(sqlite3_vfs*, int, char *); |
| 1218 | /* |
| 1219 | ** The methods above are in version 1 of the sqlite_vfs object |
| 1220 | ** definition. Those that follow are added in version 2 or later |
| 1221 | */ |
| 1222 | int (*xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); |
| 1223 | /* |
| 1224 | ** The methods above are in versions 1 and 2 of the sqlite_vfs object. |
| 1225 | ** Those below are for version 3 and greater. |
| 1226 | */ |
| 1227 | int (*xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); |
| 1228 | sqlite3_syscall_ptr (*xGetSystemCall)(sqlite3_vfs*, const char *zName); |
| 1229 | const char *(*xNextSystemCall)(sqlite3_vfs*, const char *zName); |
| 1230 | /* |
| 1231 | ** The methods above are in versions 1 through 3 of the sqlite_vfs object. |
| 1232 | ** New fields may be appended in future versions. The iVersion |
| 1233 | ** value will increment whenever this happens. |
| 1234 | */ |
| @@ -1369,14 +1378,14 @@ | |
| 1369 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1370 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1371 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1372 | ** failure. |
| 1373 | */ |
| 1374 | SQLITE_API int SQLITE_STDCALL sqlite3_initialize(void); |
| 1375 | SQLITE_API int SQLITE_STDCALL sqlite3_shutdown(void); |
| 1376 | SQLITE_API int SQLITE_STDCALL sqlite3_os_init(void); |
| 1377 | SQLITE_API int SQLITE_STDCALL sqlite3_os_end(void); |
| 1378 | |
| 1379 | /* |
| 1380 | ** CAPI3REF: Configuring The SQLite Library |
| 1381 | ** |
| 1382 | ** The sqlite3_config() interface is used to make global configuration |
| @@ -1491,17 +1500,17 @@ | |
| 1491 | ** SQLite will never invoke xInit() more than once without an intervening |
| 1492 | ** call to xShutdown(). |
| 1493 | */ |
| 1494 | typedef struct sqlite3_mem_methods sqlite3_mem_methods; |
| 1495 | struct sqlite3_mem_methods { |
| 1496 | void *(*xMalloc)(int); /* Memory allocation function */ |
| 1497 | void (*xFree)(void*); /* Free a prior allocation */ |
| 1498 | void *(*xRealloc)(void*,int); /* Resize an allocation */ |
| 1499 | int (*xSize)(void*); /* Return the size of an allocation */ |
| 1500 | int (*xRoundup)(int); /* Round up request size to allocation size */ |
| 1501 | int (*xInit)(void*); /* Initialize the memory allocator */ |
| 1502 | void (*xShutdown)(void*); /* Deinitialize the memory allocator */ |
| 1503 | void *pAppData; /* Argument to xInit() and xShutdown() */ |
| 1504 | }; |
| 1505 | |
| 1506 | /* |
| 1507 | ** CAPI3REF: Configuration Options |
| @@ -1714,11 +1723,11 @@ | |
| 1714 | ** |
| 1715 | ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt> |
| 1716 | ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite |
| 1717 | ** global [error log]. |
| 1718 | ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a |
| 1719 | ** function with a call signature of void(*)(void*,int,const char*), |
| 1720 | ** and a pointer to void. ^If the function pointer is not NULL, it is |
| 1721 | ** invoked by [sqlite3_log()] to process each logging event. ^If the |
| 1722 | ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. |
| 1723 | ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is |
| 1724 | ** passed through as the first parameter to the application-defined logger |
| @@ -1767,11 +1776,11 @@ | |
| 1767 | ** |
| 1768 | ** [[SQLITE_CONFIG_SQLLOG]] |
| 1769 | ** <dt>SQLITE_CONFIG_SQLLOG |
| 1770 | ** <dd>This option is only available if sqlite is compiled with the |
| 1771 | ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should |
| 1772 | ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int). |
| 1773 | ** The second should be of type (void*). The callback is invoked by the library |
| 1774 | ** in three separate circumstances, identified by the value passed as the |
| 1775 | ** fourth parameter. If the fourth parameter is 0, then the database connection |
| 1776 | ** passed as the second argument has just been opened. The third argument |
| 1777 | ** points to a buffer containing the name of the main database file. If the |
| @@ -1965,11 +1974,11 @@ | |
| 1965 | ** |
| 1966 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 1967 | ** [extended result codes] feature of SQLite. ^The extended result |
| 1968 | ** codes are disabled by default for historical compatibility. |
| 1969 | */ |
| 1970 | SQLITE_API int SQLITE_STDCALL sqlite3_extended_result_codes(sqlite3*, int onoff); |
| 1971 | |
| 1972 | /* |
| 1973 | ** CAPI3REF: Last Insert Rowid |
| 1974 | ** METHOD: sqlite3 |
| 1975 | ** |
| @@ -2017,11 +2026,11 @@ | |
| 2017 | ** function is running and thus changes the last insert [rowid], |
| 2018 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2019 | ** unpredictable and might not equal either the old or the new |
| 2020 | ** last insert [rowid]. |
| 2021 | */ |
| 2022 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_last_insert_rowid(sqlite3*); |
| 2023 | |
| 2024 | /* |
| 2025 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2026 | ** METHOD: sqlite3 |
| 2027 | ** |
| @@ -2070,11 +2079,11 @@ | |
| 2070 | ** |
| 2071 | ** If a separate thread makes changes on the same database connection |
| 2072 | ** while [sqlite3_changes()] is running then the value returned |
| 2073 | ** is unpredictable and not meaningful. |
| 2074 | */ |
| 2075 | SQLITE_API int SQLITE_STDCALL sqlite3_changes(sqlite3*); |
| 2076 | |
| 2077 | /* |
| 2078 | ** CAPI3REF: Total Number Of Rows Modified |
| 2079 | ** METHOD: sqlite3 |
| 2080 | ** |
| @@ -2094,11 +2103,11 @@ | |
| 2094 | ** |
| 2095 | ** If a separate thread makes changes on the same database connection |
| 2096 | ** while [sqlite3_total_changes()] is running then the value |
| 2097 | ** returned is unpredictable and not meaningful. |
| 2098 | */ |
| 2099 | SQLITE_API int SQLITE_STDCALL sqlite3_total_changes(sqlite3*); |
| 2100 | |
| 2101 | /* |
| 2102 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2103 | ** METHOD: sqlite3 |
| 2104 | ** |
| @@ -2134,11 +2143,11 @@ | |
| 2134 | ** that are started after the sqlite3_interrupt() call returns. |
| 2135 | ** |
| 2136 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2137 | ** is running then bad things will likely happen. |
| 2138 | */ |
| 2139 | SQLITE_API void SQLITE_STDCALL sqlite3_interrupt(sqlite3*); |
| 2140 | |
| 2141 | /* |
| 2142 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2143 | ** |
| 2144 | ** These routines are useful during command-line input to determine if the |
| @@ -2169,12 +2178,12 @@ | |
| 2169 | ** UTF-8 string. |
| 2170 | ** |
| 2171 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2172 | ** UTF-16 string in native byte order. |
| 2173 | */ |
| 2174 | SQLITE_API int SQLITE_STDCALL sqlite3_complete(const char *sql); |
| 2175 | SQLITE_API int SQLITE_STDCALL sqlite3_complete16(const void *sql); |
| 2176 | |
| 2177 | /* |
| 2178 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2179 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2180 | ** METHOD: sqlite3 |
| @@ -2231,11 +2240,11 @@ | |
| 2231 | ** result in undefined behavior. |
| 2232 | ** |
| 2233 | ** A busy handler must not close the database connection |
| 2234 | ** or [prepared statement] that invoked the busy handler. |
| 2235 | */ |
| 2236 | SQLITE_API int SQLITE_STDCALL sqlite3_busy_handler(sqlite3*, int(*)(void*,int), void*); |
| 2237 | |
| 2238 | /* |
| 2239 | ** CAPI3REF: Set A Busy Timeout |
| 2240 | ** METHOD: sqlite3 |
| 2241 | ** |
| @@ -2254,11 +2263,11 @@ | |
| 2254 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2255 | ** this routine, that other busy handler is cleared.)^ |
| 2256 | ** |
| 2257 | ** See also: [PRAGMA busy_timeout] |
| 2258 | */ |
| 2259 | SQLITE_API int SQLITE_STDCALL sqlite3_busy_timeout(sqlite3*, int ms); |
| 2260 | |
| 2261 | /* |
| 2262 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2263 | ** METHOD: sqlite3 |
| 2264 | ** |
| @@ -2329,19 +2338,19 @@ | |
| 2329 | ** interface defined here. As a consequence, errors that occur in the |
| 2330 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2331 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2332 | ** [sqlite3_errmsg()]. |
| 2333 | */ |
| 2334 | SQLITE_API int SQLITE_STDCALL sqlite3_get_table( |
| 2335 | sqlite3 *db, /* An open database */ |
| 2336 | const char *zSql, /* SQL to be evaluated */ |
| 2337 | char ***pazResult, /* Results of the query */ |
| 2338 | int *pnRow, /* Number of result rows written here */ |
| 2339 | int *pnColumn, /* Number of result columns written here */ |
| 2340 | char **pzErrmsg /* Error msg written here */ |
| 2341 | ); |
| 2342 | SQLITE_API void SQLITE_STDCALL sqlite3_free_table(char **result); |
| 2343 | |
| 2344 | /* |
| 2345 | ** CAPI3REF: Formatted String Printing Functions |
| 2346 | ** |
| 2347 | ** These routines are work-alikes of the "printf()" family of functions |
| @@ -2444,13 +2453,13 @@ | |
| 2444 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2445 | ** addition that after the string has been read and copied into |
| 2446 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2447 | */ |
| 2448 | SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2449 | SQLITE_API char *SQLITE_STDCALL sqlite3_vmprintf(const char*, va_list); |
| 2450 | SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2451 | SQLITE_API char *SQLITE_STDCALL sqlite3_vsnprintf(int,char*,const char*, va_list); |
| 2452 | |
| 2453 | /* |
| 2454 | ** CAPI3REF: Memory Allocation Subsystem |
| 2455 | ** |
| 2456 | ** The SQLite core uses these three routines for all of its own |
| @@ -2536,16 +2545,16 @@ | |
| 2536 | ** |
| 2537 | ** The application must not read or write any part of |
| 2538 | ** a block of memory after it has been released using |
| 2539 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2540 | */ |
| 2541 | SQLITE_API void *SQLITE_STDCALL sqlite3_malloc(int); |
| 2542 | SQLITE_API void *SQLITE_STDCALL sqlite3_malloc64(sqlite3_uint64); |
| 2543 | SQLITE_API void *SQLITE_STDCALL sqlite3_realloc(void*, int); |
| 2544 | SQLITE_API void *SQLITE_STDCALL sqlite3_realloc64(void*, sqlite3_uint64); |
| 2545 | SQLITE_API void SQLITE_STDCALL sqlite3_free(void*); |
| 2546 | SQLITE_API sqlite3_uint64 SQLITE_STDCALL sqlite3_msize(void*); |
| 2547 | |
| 2548 | /* |
| 2549 | ** CAPI3REF: Memory Allocator Statistics |
| 2550 | ** |
| 2551 | ** SQLite provides these two interfaces for reporting on the status |
| @@ -2566,12 +2575,12 @@ | |
| 2566 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2567 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2568 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2569 | ** prior to the reset. |
| 2570 | */ |
| 2571 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_used(void); |
| 2572 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_memory_highwater(int resetFlag); |
| 2573 | |
| 2574 | /* |
| 2575 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2576 | ** |
| 2577 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| @@ -2590,11 +2599,11 @@ | |
| 2590 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2591 | ** non-NULL P then the pseudo-randomness is generated |
| 2592 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2593 | ** method. |
| 2594 | */ |
| 2595 | SQLITE_API void SQLITE_STDCALL sqlite3_randomness(int N, void *P); |
| 2596 | |
| 2597 | /* |
| 2598 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2599 | ** METHOD: sqlite3 |
| 2600 | ** |
| @@ -2673,13 +2682,13 @@ | |
| 2673 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2674 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2675 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2676 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2677 | */ |
| 2678 | SQLITE_API int SQLITE_STDCALL sqlite3_set_authorizer( |
| 2679 | sqlite3*, |
| 2680 | int (*xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 2681 | void *pUserData |
| 2682 | ); |
| 2683 | |
| 2684 | /* |
| 2685 | ** CAPI3REF: Authorizer Return Codes |
| @@ -2781,14 +2790,14 @@ | |
| 2781 | ** digits in the time are meaningless. Future versions of SQLite |
| 2782 | ** might provide greater resolution on the profiler callback. The |
| 2783 | ** sqlite3_profile() function is considered experimental and is |
| 2784 | ** subject to change in future versions of SQLite. |
| 2785 | */ |
| 2786 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_trace(sqlite3*, |
| 2787 | void(*xTrace)(void*,const char*), void*); |
| 2788 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_STDCALL sqlite3_profile(sqlite3*, |
| 2789 | void(*xProfile)(void*,const char*,sqlite3_uint64), void*); |
| 2790 | |
| 2791 | /* |
| 2792 | ** CAPI3REF: SQL Trace Event Codes |
| 2793 | ** KEYWORDS: SQLITE_TRACE |
| 2794 | ** |
| @@ -2872,14 +2881,14 @@ | |
| 2872 | ** |
| 2873 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 2874 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 2875 | ** are deprecated. |
| 2876 | */ |
| 2877 | SQLITE_API int SQLITE_STDCALL sqlite3_trace_v2( |
| 2878 | sqlite3*, |
| 2879 | unsigned uMask, |
| 2880 | int(*xCallback)(unsigned,void*,void*,void*), |
| 2881 | void *pCtx |
| 2882 | ); |
| 2883 | |
| 2884 | /* |
| 2885 | ** CAPI3REF: Query Progress Callbacks |
| @@ -2911,11 +2920,11 @@ | |
| 2911 | ** the database connection that invoked the progress handler. |
| 2912 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 2913 | ** database connections for the meaning of "modify" in this paragraph. |
| 2914 | ** |
| 2915 | */ |
| 2916 | SQLITE_API void SQLITE_STDCALL sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); |
| 2917 | |
| 2918 | /* |
| 2919 | ** CAPI3REF: Opening A New Database Connection |
| 2920 | ** CONSTRUCTOR: sqlite3 |
| 2921 | ** |
| @@ -3140,19 +3149,19 @@ | |
| 3140 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3141 | ** features that require the use of temporary files may fail. |
| 3142 | ** |
| 3143 | ** See also: [sqlite3_temp_directory] |
| 3144 | */ |
| 3145 | SQLITE_API int SQLITE_STDCALL sqlite3_open( |
| 3146 | const char *filename, /* Database filename (UTF-8) */ |
| 3147 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3148 | ); |
| 3149 | SQLITE_API int SQLITE_STDCALL sqlite3_open16( |
| 3150 | const void *filename, /* Database filename (UTF-16) */ |
| 3151 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3152 | ); |
| 3153 | SQLITE_API int SQLITE_STDCALL sqlite3_open_v2( |
| 3154 | const char *filename, /* Database filename (UTF-8) */ |
| 3155 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3156 | int flags, /* Flags */ |
| 3157 | const char *zVfs /* Name of VFS module to use */ |
| 3158 | ); |
| @@ -3194,13 +3203,13 @@ | |
| 3194 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3195 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3196 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3197 | ** undesirable. |
| 3198 | */ |
| 3199 | SQLITE_API const char *SQLITE_STDCALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); |
| 3200 | SQLITE_API int SQLITE_STDCALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); |
| 3201 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); |
| 3202 | |
| 3203 | |
| 3204 | /* |
| 3205 | ** CAPI3REF: Error Codes And Messages |
| 3206 | ** METHOD: sqlite3 |
| @@ -3240,15 +3249,15 @@ | |
| 3240 | ** |
| 3241 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3242 | ** was invoked incorrectly by the application. In that case, the |
| 3243 | ** error code and message may or may not be set. |
| 3244 | */ |
| 3245 | SQLITE_API int SQLITE_STDCALL sqlite3_errcode(sqlite3 *db); |
| 3246 | SQLITE_API int SQLITE_STDCALL sqlite3_extended_errcode(sqlite3 *db); |
| 3247 | SQLITE_API const char *SQLITE_STDCALL sqlite3_errmsg(sqlite3*); |
| 3248 | SQLITE_API const void *SQLITE_STDCALL sqlite3_errmsg16(sqlite3*); |
| 3249 | SQLITE_API const char *SQLITE_STDCALL sqlite3_errstr(int); |
| 3250 | |
| 3251 | /* |
| 3252 | ** CAPI3REF: Prepared Statement Object |
| 3253 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3254 | ** |
| @@ -3312,11 +3321,11 @@ | |
| 3312 | ** created by an untrusted script can be contained using the |
| 3313 | ** [max_page_count] [PRAGMA]. |
| 3314 | ** |
| 3315 | ** New run-time limit categories may be added in future releases. |
| 3316 | */ |
| 3317 | SQLITE_API int SQLITE_STDCALL sqlite3_limit(sqlite3*, int id, int newVal); |
| 3318 | |
| 3319 | /* |
| 3320 | ** CAPI3REF: Run-Time Limit Categories |
| 3321 | ** KEYWORDS: {limit category} {*limit categories} |
| 3322 | ** |
| @@ -3464,32 +3473,32 @@ | |
| 3464 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3465 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3466 | ** </li> |
| 3467 | ** </ol> |
| 3468 | */ |
| 3469 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare( |
| 3470 | sqlite3 *db, /* Database handle */ |
| 3471 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3472 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3473 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3474 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3475 | ); |
| 3476 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare_v2( |
| 3477 | sqlite3 *db, /* Database handle */ |
| 3478 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3479 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3480 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3481 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3482 | ); |
| 3483 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare16( |
| 3484 | sqlite3 *db, /* Database handle */ |
| 3485 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3486 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3487 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3488 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3489 | ); |
| 3490 | SQLITE_API int SQLITE_STDCALL sqlite3_prepare16_v2( |
| 3491 | sqlite3 *db, /* Database handle */ |
| 3492 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3493 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3494 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3495 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| @@ -3524,12 +3533,12 @@ | |
| 3524 | ** automatically freed when the prepared statement is finalized. |
| 3525 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3526 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3527 | ** by passing it to [sqlite3_free()]. |
| 3528 | */ |
| 3529 | SQLITE_API const char *SQLITE_STDCALL sqlite3_sql(sqlite3_stmt *pStmt); |
| 3530 | SQLITE_API char *SQLITE_STDCALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); |
| 3531 | |
| 3532 | /* |
| 3533 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3534 | ** METHOD: sqlite3_stmt |
| 3535 | ** |
| @@ -3557,11 +3566,11 @@ | |
| 3557 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3558 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3559 | ** change the configuration of a database connection, they do not make |
| 3560 | ** changes to the content of the database files on disk. |
| 3561 | */ |
| 3562 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 3563 | |
| 3564 | /* |
| 3565 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3566 | ** METHOD: sqlite3_stmt |
| 3567 | ** |
| @@ -3578,11 +3587,11 @@ | |
| 3578 | ** to locate all prepared statements associated with a database |
| 3579 | ** connection that are in need of being reset. This can be used, |
| 3580 | ** for example, in diagnostic routines to search for prepared |
| 3581 | ** statements that are holding a transaction open. |
| 3582 | */ |
| 3583 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_busy(sqlite3_stmt*); |
| 3584 | |
| 3585 | /* |
| 3586 | ** CAPI3REF: Dynamically Typed Value Object |
| 3587 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3588 | ** |
| @@ -3742,24 +3751,24 @@ | |
| 3742 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 3743 | ** |
| 3744 | ** See also: [sqlite3_bind_parameter_count()], |
| 3745 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 3746 | */ |
| 3747 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); |
| 3748 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, |
| 3749 | void(*)(void*)); |
| 3750 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_double(sqlite3_stmt*, int, double); |
| 3751 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_int(sqlite3_stmt*, int, int); |
| 3752 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); |
| 3753 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_null(sqlite3_stmt*, int); |
| 3754 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(*)(void*)); |
| 3755 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(*)(void*)); |
| 3756 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 3757 | void(*)(void*), unsigned char encoding); |
| 3758 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 3759 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 3760 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); |
| 3761 | |
| 3762 | /* |
| 3763 | ** CAPI3REF: Number Of SQL Parameters |
| 3764 | ** METHOD: sqlite3_stmt |
| 3765 | ** |
| @@ -3776,11 +3785,11 @@ | |
| 3776 | ** |
| 3777 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3778 | ** [sqlite3_bind_parameter_name()], and |
| 3779 | ** [sqlite3_bind_parameter_index()]. |
| 3780 | */ |
| 3781 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_count(sqlite3_stmt*); |
| 3782 | |
| 3783 | /* |
| 3784 | ** CAPI3REF: Name Of A Host Parameter |
| 3785 | ** METHOD: sqlite3_stmt |
| 3786 | ** |
| @@ -3804,11 +3813,11 @@ | |
| 3804 | ** |
| 3805 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3806 | ** [sqlite3_bind_parameter_count()], and |
| 3807 | ** [sqlite3_bind_parameter_index()]. |
| 3808 | */ |
| 3809 | SQLITE_API const char *SQLITE_STDCALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); |
| 3810 | |
| 3811 | /* |
| 3812 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 3813 | ** METHOD: sqlite3_stmt |
| 3814 | ** |
| @@ -3821,21 +3830,21 @@ | |
| 3821 | ** |
| 3822 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3823 | ** [sqlite3_bind_parameter_count()], and |
| 3824 | ** [sqlite3_bind_parameter_name()]. |
| 3825 | */ |
| 3826 | SQLITE_API int SQLITE_STDCALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); |
| 3827 | |
| 3828 | /* |
| 3829 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 3830 | ** METHOD: sqlite3_stmt |
| 3831 | ** |
| 3832 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 3833 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 3834 | ** ^Use this routine to reset all host parameters to NULL. |
| 3835 | */ |
| 3836 | SQLITE_API int SQLITE_STDCALL sqlite3_clear_bindings(sqlite3_stmt*); |
| 3837 | |
| 3838 | /* |
| 3839 | ** CAPI3REF: Number Of Columns In A Result Set |
| 3840 | ** METHOD: sqlite3_stmt |
| 3841 | ** |
| @@ -3843,11 +3852,11 @@ | |
| 3843 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 3844 | ** statement that does not return data (for example an [UPDATE]). |
| 3845 | ** |
| 3846 | ** See also: [sqlite3_data_count()] |
| 3847 | */ |
| 3848 | SQLITE_API int SQLITE_STDCALL sqlite3_column_count(sqlite3_stmt *pStmt); |
| 3849 | |
| 3850 | /* |
| 3851 | ** CAPI3REF: Column Names In A Result Set |
| 3852 | ** METHOD: sqlite3_stmt |
| 3853 | ** |
| @@ -3872,12 +3881,12 @@ | |
| 3872 | ** ^The name of a result column is the value of the "AS" clause for |
| 3873 | ** that column, if there is an AS clause. If there is no AS clause |
| 3874 | ** then the name of the column is unspecified and may change from |
| 3875 | ** one release of SQLite to the next. |
| 3876 | */ |
| 3877 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_name(sqlite3_stmt*, int N); |
| 3878 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_name16(sqlite3_stmt*, int N); |
| 3879 | |
| 3880 | /* |
| 3881 | ** CAPI3REF: Source Of Data In A Query Result |
| 3882 | ** METHOD: sqlite3_stmt |
| 3883 | ** |
| @@ -3921,16 +3930,16 @@ | |
| 3921 | ** If two or more threads call one or more |
| 3922 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 3923 | ** for the same [prepared statement] and result column |
| 3924 | ** at the same time then the results are undefined. |
| 3925 | */ |
| 3926 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_database_name(sqlite3_stmt*,int); |
| 3927 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_database_name16(sqlite3_stmt*,int); |
| 3928 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_table_name(sqlite3_stmt*,int); |
| 3929 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_table_name16(sqlite3_stmt*,int); |
| 3930 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_origin_name(sqlite3_stmt*,int); |
| 3931 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_origin_name16(sqlite3_stmt*,int); |
| 3932 | |
| 3933 | /* |
| 3934 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 3935 | ** METHOD: sqlite3_stmt |
| 3936 | ** |
| @@ -3958,12 +3967,12 @@ | |
| 3958 | ** data stored in that column is of the declared type. SQLite is |
| 3959 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 3960 | ** is associated with individual values, not with the containers |
| 3961 | ** used to hold those values. |
| 3962 | */ |
| 3963 | SQLITE_API const char *SQLITE_STDCALL sqlite3_column_decltype(sqlite3_stmt*,int); |
| 3964 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_decltype16(sqlite3_stmt*,int); |
| 3965 | |
| 3966 | /* |
| 3967 | ** CAPI3REF: Evaluate An SQL Statement |
| 3968 | ** METHOD: sqlite3_stmt |
| 3969 | ** |
| @@ -4039,11 +4048,11 @@ | |
| 4039 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4040 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4041 | ** then the more specific [error codes] are returned directly |
| 4042 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4043 | */ |
| 4044 | SQLITE_API int SQLITE_STDCALL sqlite3_step(sqlite3_stmt*); |
| 4045 | |
| 4046 | /* |
| 4047 | ** CAPI3REF: Number of columns in a result set |
| 4048 | ** METHOD: sqlite3_stmt |
| 4049 | ** |
| @@ -4060,11 +4069,11 @@ | |
| 4060 | ** where it always returns zero since each step of that multi-step |
| 4061 | ** pragma returns 0 columns of data. |
| 4062 | ** |
| 4063 | ** See also: [sqlite3_column_count()] |
| 4064 | */ |
| 4065 | SQLITE_API int SQLITE_STDCALL sqlite3_data_count(sqlite3_stmt *pStmt); |
| 4066 | |
| 4067 | /* |
| 4068 | ** CAPI3REF: Fundamental Datatypes |
| 4069 | ** KEYWORDS: SQLITE_TEXT |
| 4070 | ** |
| @@ -4250,20 +4259,20 @@ | |
| 4250 | ** of these routines, a default value is returned. The default value |
| 4251 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4252 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4253 | ** [SQLITE_NOMEM].)^ |
| 4254 | */ |
| 4255 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_blob(sqlite3_stmt*, int iCol); |
| 4256 | SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); |
| 4257 | SQLITE_API int SQLITE_STDCALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); |
| 4258 | SQLITE_API double SQLITE_STDCALL sqlite3_column_double(sqlite3_stmt*, int iCol); |
| 4259 | SQLITE_API int SQLITE_STDCALL sqlite3_column_int(sqlite3_stmt*, int iCol); |
| 4260 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_column_int64(sqlite3_stmt*, int iCol); |
| 4261 | SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_column_text(sqlite3_stmt*, int iCol); |
| 4262 | SQLITE_API const void *SQLITE_STDCALL sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 4263 | SQLITE_API int SQLITE_STDCALL sqlite3_column_type(sqlite3_stmt*, int iCol); |
| 4264 | SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_column_value(sqlite3_stmt*, int iCol); |
| 4265 | |
| 4266 | /* |
| 4267 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4268 | ** DESTRUCTOR: sqlite3_stmt |
| 4269 | ** |
| @@ -4287,11 +4296,11 @@ | |
| 4287 | ** resource leaks. It is a grievous error for the application to try to use |
| 4288 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4289 | ** statement after it has been finalized can result in undefined and |
| 4290 | ** undesirable behavior such as segfaults and heap corruption. |
| 4291 | */ |
| 4292 | SQLITE_API int SQLITE_STDCALL sqlite3_finalize(sqlite3_stmt *pStmt); |
| 4293 | |
| 4294 | /* |
| 4295 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4296 | ** METHOD: sqlite3_stmt |
| 4297 | ** |
| @@ -4314,11 +4323,11 @@ | |
| 4314 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4315 | ** |
| 4316 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4317 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4318 | */ |
| 4319 | SQLITE_API int SQLITE_STDCALL sqlite3_reset(sqlite3_stmt *pStmt); |
| 4320 | |
| 4321 | /* |
| 4322 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4323 | ** KEYWORDS: {function creation routines} |
| 4324 | ** KEYWORDS: {application-defined SQL function} |
| @@ -4414,40 +4423,40 @@ | |
| 4414 | ** ^An application-defined function is permitted to call other |
| 4415 | ** SQLite interfaces. However, such calls must not |
| 4416 | ** close the database connection nor finalize or reset the prepared |
| 4417 | ** statement in which the function is running. |
| 4418 | */ |
| 4419 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function( |
| 4420 | sqlite3 *db, |
| 4421 | const char *zFunctionName, |
| 4422 | int nArg, |
| 4423 | int eTextRep, |
| 4424 | void *pApp, |
| 4425 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4426 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4427 | void (*xFinal)(sqlite3_context*) |
| 4428 | ); |
| 4429 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function16( |
| 4430 | sqlite3 *db, |
| 4431 | const void *zFunctionName, |
| 4432 | int nArg, |
| 4433 | int eTextRep, |
| 4434 | void *pApp, |
| 4435 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4436 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4437 | void (*xFinal)(sqlite3_context*) |
| 4438 | ); |
| 4439 | SQLITE_API int SQLITE_STDCALL sqlite3_create_function_v2( |
| 4440 | sqlite3 *db, |
| 4441 | const char *zFunctionName, |
| 4442 | int nArg, |
| 4443 | int eTextRep, |
| 4444 | void *pApp, |
| 4445 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4446 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4447 | void (*xFinal)(sqlite3_context*), |
| 4448 | void(*xDestroy)(void*) |
| 4449 | ); |
| 4450 | |
| 4451 | /* |
| 4452 | ** CAPI3REF: Text Encodings |
| 4453 | ** |
| @@ -4480,16 +4489,16 @@ | |
| 4480 | ** to be supported. However, new applications should avoid |
| 4481 | ** the use of these functions. To encourage programmers to avoid |
| 4482 | ** these functions, we will not explain what they do. |
| 4483 | */ |
| 4484 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4485 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_aggregate_count(sqlite3_context*); |
| 4486 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_expired(sqlite3_stmt*); |
| 4487 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); |
| 4488 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_global_recover(void); |
| 4489 | SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_thread_cleanup(void); |
| 4490 | SQLITE_API SQLITE_DEPRECATED int SQLITE_STDCALL sqlite3_memory_alarm(void(*)(void*,sqlite3_int64,int), |
| 4491 | void*,sqlite3_int64); |
| 4492 | #endif |
| 4493 | |
| 4494 | /* |
| 4495 | ** CAPI3REF: Obtaining SQL Values |
| @@ -4535,22 +4544,22 @@ | |
| 4535 | ** or [sqlite3_value_text16()]. |
| 4536 | ** |
| 4537 | ** These routines must be called from the same thread as |
| 4538 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4539 | */ |
| 4540 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_blob(sqlite3_value*); |
| 4541 | SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes(sqlite3_value*); |
| 4542 | SQLITE_API int SQLITE_STDCALL sqlite3_value_bytes16(sqlite3_value*); |
| 4543 | SQLITE_API double SQLITE_STDCALL sqlite3_value_double(sqlite3_value*); |
| 4544 | SQLITE_API int SQLITE_STDCALL sqlite3_value_int(sqlite3_value*); |
| 4545 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_value_int64(sqlite3_value*); |
| 4546 | SQLITE_API const unsigned char *SQLITE_STDCALL sqlite3_value_text(sqlite3_value*); |
| 4547 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16(sqlite3_value*); |
| 4548 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16le(sqlite3_value*); |
| 4549 | SQLITE_API const void *SQLITE_STDCALL sqlite3_value_text16be(sqlite3_value*); |
| 4550 | SQLITE_API int SQLITE_STDCALL sqlite3_value_type(sqlite3_value*); |
| 4551 | SQLITE_API int SQLITE_STDCALL sqlite3_value_numeric_type(sqlite3_value*); |
| 4552 | |
| 4553 | /* |
| 4554 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4555 | ** METHOD: sqlite3_value |
| 4556 | ** |
| @@ -4562,11 +4571,11 @@ | |
| 4562 | ** |
| 4563 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4564 | ** from the result of one [application-defined SQL function] into the |
| 4565 | ** input of another. |
| 4566 | */ |
| 4567 | SQLITE_API unsigned int SQLITE_STDCALL sqlite3_value_subtype(sqlite3_value*); |
| 4568 | |
| 4569 | /* |
| 4570 | ** CAPI3REF: Copy And Free SQL Values |
| 4571 | ** METHOD: sqlite3_value |
| 4572 | ** |
| @@ -4578,12 +4587,12 @@ | |
| 4578 | ** |
| 4579 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4580 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4581 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4582 | */ |
| 4583 | SQLITE_API sqlite3_value *SQLITE_STDCALL sqlite3_value_dup(const sqlite3_value*); |
| 4584 | SQLITE_API void SQLITE_STDCALL sqlite3_value_free(sqlite3_value*); |
| 4585 | |
| 4586 | /* |
| 4587 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4588 | ** METHOD: sqlite3_context |
| 4589 | ** |
| @@ -4624,11 +4633,11 @@ | |
| 4624 | ** function. |
| 4625 | ** |
| 4626 | ** This routine must be called from the same thread in which |
| 4627 | ** the aggregate SQL function is running. |
| 4628 | */ |
| 4629 | SQLITE_API void *SQLITE_STDCALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); |
| 4630 | |
| 4631 | /* |
| 4632 | ** CAPI3REF: User Data For Functions |
| 4633 | ** METHOD: sqlite3_context |
| 4634 | ** |
| @@ -4639,11 +4648,11 @@ | |
| 4639 | ** registered the application defined function. |
| 4640 | ** |
| 4641 | ** This routine must be called from the same thread in which |
| 4642 | ** the application-defined function is running. |
| 4643 | */ |
| 4644 | SQLITE_API void *SQLITE_STDCALL sqlite3_user_data(sqlite3_context*); |
| 4645 | |
| 4646 | /* |
| 4647 | ** CAPI3REF: Database Connection For Functions |
| 4648 | ** METHOD: sqlite3_context |
| 4649 | ** |
| @@ -4651,11 +4660,11 @@ | |
| 4651 | ** the pointer to the [database connection] (the 1st parameter) |
| 4652 | ** of the [sqlite3_create_function()] |
| 4653 | ** and [sqlite3_create_function16()] routines that originally |
| 4654 | ** registered the application defined function. |
| 4655 | */ |
| 4656 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_context_db_handle(sqlite3_context*); |
| 4657 | |
| 4658 | /* |
| 4659 | ** CAPI3REF: Function Auxiliary Data |
| 4660 | ** METHOD: sqlite3_context |
| 4661 | ** |
| @@ -4704,12 +4713,12 @@ | |
| 4704 | ** values and [parameters] and expressions composed from the same.)^ |
| 4705 | ** |
| 4706 | ** These routines must be called from the same thread in which |
| 4707 | ** the SQL function is running. |
| 4708 | */ |
| 4709 | SQLITE_API void *SQLITE_STDCALL sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4710 | SQLITE_API void SQLITE_STDCALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(void*)); |
| 4711 | |
| 4712 | |
| 4713 | /* |
| 4714 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 4715 | ** |
| @@ -4722,11 +4731,11 @@ | |
| 4722 | ** the content before returning. |
| 4723 | ** |
| 4724 | ** The typedef is necessary to work around problems in certain |
| 4725 | ** C++ compilers. |
| 4726 | */ |
| 4727 | typedef void (*sqlite3_destructor_type)(void*); |
| 4728 | #define SQLITE_STATIC ((sqlite3_destructor_type)0) |
| 4729 | #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) |
| 4730 | |
| 4731 | /* |
| 4732 | ** CAPI3REF: Setting The Result Of An SQL Function |
| @@ -4841,31 +4850,31 @@ | |
| 4841 | ** |
| 4842 | ** If these routines are called from within the different thread |
| 4843 | ** than the one containing the application-defined function that received |
| 4844 | ** the [sqlite3_context] pointer, the results are undefined. |
| 4845 | */ |
| 4846 | SQLITE_API void SQLITE_STDCALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(*)(void*)); |
| 4847 | SQLITE_API void SQLITE_STDCALL sqlite3_result_blob64(sqlite3_context*,const void*, |
| 4848 | sqlite3_uint64,void(*)(void*)); |
| 4849 | SQLITE_API void SQLITE_STDCALL sqlite3_result_double(sqlite3_context*, double); |
| 4850 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error(sqlite3_context*, const char*, int); |
| 4851 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error16(sqlite3_context*, const void*, int); |
| 4852 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_toobig(sqlite3_context*); |
| 4853 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_nomem(sqlite3_context*); |
| 4854 | SQLITE_API void SQLITE_STDCALL sqlite3_result_error_code(sqlite3_context*, int); |
| 4855 | SQLITE_API void SQLITE_STDCALL sqlite3_result_int(sqlite3_context*, int); |
| 4856 | SQLITE_API void SQLITE_STDCALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); |
| 4857 | SQLITE_API void SQLITE_STDCALL sqlite3_result_null(sqlite3_context*); |
| 4858 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text(sqlite3_context*, const char*, int, void(*)(void*)); |
| 4859 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, |
| 4860 | void(*)(void*), unsigned char encoding); |
| 4861 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(*)(void*)); |
| 4862 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4863 | SQLITE_API void SQLITE_STDCALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(*)(void*)); |
| 4864 | SQLITE_API void SQLITE_STDCALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 4865 | SQLITE_API void SQLITE_STDCALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 4866 | SQLITE_API int SQLITE_STDCALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); |
| 4867 | |
| 4868 | |
| 4869 | /* |
| 4870 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 4871 | ** METHOD: sqlite3_context |
| @@ -4876,11 +4885,11 @@ | |
| 4876 | ** of the subtype T are preserved in current versions of SQLite; |
| 4877 | ** higher order bits are discarded. |
| 4878 | ** The number of subtype bytes preserved by SQLite might increase |
| 4879 | ** in future releases of SQLite. |
| 4880 | */ |
| 4881 | SQLITE_API void SQLITE_STDCALL sqlite3_result_subtype(sqlite3_context*,unsigned int); |
| 4882 | |
| 4883 | /* |
| 4884 | ** CAPI3REF: Define New Collating Sequences |
| 4885 | ** METHOD: sqlite3 |
| 4886 | ** |
| @@ -4958,31 +4967,31 @@ | |
| 4958 | ** is unfortunate but cannot be changed without breaking backwards |
| 4959 | ** compatibility. |
| 4960 | ** |
| 4961 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 4962 | */ |
| 4963 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation( |
| 4964 | sqlite3*, |
| 4965 | const char *zName, |
| 4966 | int eTextRep, |
| 4967 | void *pArg, |
| 4968 | int(*xCompare)(void*,int,const void*,int,const void*) |
| 4969 | ); |
| 4970 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation_v2( |
| 4971 | sqlite3*, |
| 4972 | const char *zName, |
| 4973 | int eTextRep, |
| 4974 | void *pArg, |
| 4975 | int(*xCompare)(void*,int,const void*,int,const void*), |
| 4976 | void(*xDestroy)(void*) |
| 4977 | ); |
| 4978 | SQLITE_API int SQLITE_STDCALL sqlite3_create_collation16( |
| 4979 | sqlite3*, |
| 4980 | const void *zName, |
| 4981 | int eTextRep, |
| 4982 | void *pArg, |
| 4983 | int(*xCompare)(void*,int,const void*,int,const void*) |
| 4984 | ); |
| 4985 | |
| 4986 | /* |
| 4987 | ** CAPI3REF: Collation Needed Callbacks |
| 4988 | ** METHOD: sqlite3 |
| @@ -5008,19 +5017,19 @@ | |
| 5008 | ** |
| 5009 | ** The callback function should register the desired collation using |
| 5010 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5011 | ** [sqlite3_create_collation_v2()]. |
| 5012 | */ |
| 5013 | SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed( |
| 5014 | sqlite3*, |
| 5015 | void*, |
| 5016 | void(*)(void*,sqlite3*,int eTextRep,const char*) |
| 5017 | ); |
| 5018 | SQLITE_API int SQLITE_STDCALL sqlite3_collation_needed16( |
| 5019 | sqlite3*, |
| 5020 | void*, |
| 5021 | void(*)(void*,sqlite3*,int eTextRep,const void*) |
| 5022 | ); |
| 5023 | |
| 5024 | #ifdef SQLITE_HAS_CODEC |
| 5025 | /* |
| 5026 | ** Specify the key for an encrypted database. This routine should be |
| @@ -5027,15 +5036,15 @@ | |
| 5027 | ** called right after sqlite3_open(). |
| 5028 | ** |
| 5029 | ** The code to implement this API is not available in the public release |
| 5030 | ** of SQLite. |
| 5031 | */ |
| 5032 | SQLITE_API int SQLITE_STDCALL sqlite3_key( |
| 5033 | sqlite3 *db, /* Database to be rekeyed */ |
| 5034 | const void *pKey, int nKey /* The key */ |
| 5035 | ); |
| 5036 | SQLITE_API int SQLITE_STDCALL sqlite3_key_v2( |
| 5037 | sqlite3 *db, /* Database to be rekeyed */ |
| 5038 | const char *zDbName, /* Name of the database */ |
| 5039 | const void *pKey, int nKey /* The key */ |
| 5040 | ); |
| 5041 | |
| @@ -5045,35 +5054,35 @@ | |
| 5045 | ** database is decrypted. |
| 5046 | ** |
| 5047 | ** The code to implement this API is not available in the public release |
| 5048 | ** of SQLite. |
| 5049 | */ |
| 5050 | SQLITE_API int SQLITE_STDCALL sqlite3_rekey( |
| 5051 | sqlite3 *db, /* Database to be rekeyed */ |
| 5052 | const void *pKey, int nKey /* The new key */ |
| 5053 | ); |
| 5054 | SQLITE_API int SQLITE_STDCALL sqlite3_rekey_v2( |
| 5055 | sqlite3 *db, /* Database to be rekeyed */ |
| 5056 | const char *zDbName, /* Name of the database */ |
| 5057 | const void *pKey, int nKey /* The new key */ |
| 5058 | ); |
| 5059 | |
| 5060 | /* |
| 5061 | ** Specify the activation key for a SEE database. Unless |
| 5062 | ** activated, none of the SEE routines will work. |
| 5063 | */ |
| 5064 | SQLITE_API void SQLITE_STDCALL sqlite3_activate_see( |
| 5065 | const char *zPassPhrase /* Activation phrase */ |
| 5066 | ); |
| 5067 | #endif |
| 5068 | |
| 5069 | #ifdef SQLITE_ENABLE_CEROD |
| 5070 | /* |
| 5071 | ** Specify the activation key for a CEROD database. Unless |
| 5072 | ** activated, none of the CEROD routines will work. |
| 5073 | */ |
| 5074 | SQLITE_API void SQLITE_STDCALL sqlite3_activate_cerod( |
| 5075 | const char *zPassPhrase /* Activation phrase */ |
| 5076 | ); |
| 5077 | #endif |
| 5078 | |
| 5079 | /* |
| @@ -5091,11 +5100,11 @@ | |
| 5091 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5092 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5093 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5094 | ** in the previous paragraphs. |
| 5095 | */ |
| 5096 | SQLITE_API int SQLITE_STDCALL sqlite3_sleep(int); |
| 5097 | |
| 5098 | /* |
| 5099 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5100 | ** |
| 5101 | ** ^(If this global variable is made to point to a string which is |
| @@ -5210,11 +5219,11 @@ | |
| 5210 | ** |
| 5211 | ** If another thread changes the autocommit status of the database |
| 5212 | ** connection while this routine is running, then the return value |
| 5213 | ** is undefined. |
| 5214 | */ |
| 5215 | SQLITE_API int SQLITE_STDCALL sqlite3_get_autocommit(sqlite3*); |
| 5216 | |
| 5217 | /* |
| 5218 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5219 | ** METHOD: sqlite3_stmt |
| 5220 | ** |
| @@ -5223,11 +5232,11 @@ | |
| 5223 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5224 | ** that was the first argument |
| 5225 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5226 | ** create the statement in the first place. |
| 5227 | */ |
| 5228 | SQLITE_API sqlite3 *SQLITE_STDCALL sqlite3_db_handle(sqlite3_stmt*); |
| 5229 | |
| 5230 | /* |
| 5231 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5232 | ** METHOD: sqlite3 |
| 5233 | ** |
| @@ -5240,21 +5249,21 @@ | |
| 5240 | ** ^The filename returned by this function is the output of the |
| 5241 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5242 | ** will be an absolute pathname, even if the filename used |
| 5243 | ** to open the database originally was a URI or relative pathname. |
| 5244 | */ |
| 5245 | SQLITE_API const char *SQLITE_STDCALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 5246 | |
| 5247 | /* |
| 5248 | ** CAPI3REF: Determine if a database is read-only |
| 5249 | ** METHOD: sqlite3 |
| 5250 | ** |
| 5251 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5252 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5253 | ** the name of a database on connection D. |
| 5254 | */ |
| 5255 | SQLITE_API int SQLITE_STDCALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); |
| 5256 | |
| 5257 | /* |
| 5258 | ** CAPI3REF: Find the next prepared statement |
| 5259 | ** METHOD: sqlite3 |
| 5260 | ** |
| @@ -5266,11 +5275,11 @@ | |
| 5266 | ** |
| 5267 | ** The [database connection] pointer D in a call to |
| 5268 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5269 | ** connection and in particular must not be a NULL pointer. |
| 5270 | */ |
| 5271 | SQLITE_API sqlite3_stmt *SQLITE_STDCALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); |
| 5272 | |
| 5273 | /* |
| 5274 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5275 | ** METHOD: sqlite3 |
| 5276 | ** |
| @@ -5315,12 +5324,12 @@ | |
| 5315 | ** ^The rollback callback is not invoked if a transaction is |
| 5316 | ** automatically rolled back because the database connection is closed. |
| 5317 | ** |
| 5318 | ** See also the [sqlite3_update_hook()] interface. |
| 5319 | */ |
| 5320 | SQLITE_API void *SQLITE_STDCALL sqlite3_commit_hook(sqlite3*, int(*)(void*), void*); |
| 5321 | SQLITE_API void *SQLITE_STDCALL sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); |
| 5322 | |
| 5323 | /* |
| 5324 | ** CAPI3REF: Data Change Notification Callbacks |
| 5325 | ** METHOD: sqlite3 |
| 5326 | ** |
| @@ -5367,13 +5376,13 @@ | |
| 5367 | ** the first call on D. |
| 5368 | ** |
| 5369 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5370 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5371 | */ |
| 5372 | SQLITE_API void *SQLITE_STDCALL sqlite3_update_hook( |
| 5373 | sqlite3*, |
| 5374 | void(*)(void *,int ,char const *,char const *,sqlite3_int64), |
| 5375 | void* |
| 5376 | ); |
| 5377 | |
| 5378 | /* |
| 5379 | ** CAPI3REF: Enable Or Disable Shared Pager Cache |
| @@ -5407,11 +5416,11 @@ | |
| 5407 | ** This interface is threadsafe on processors where writing a |
| 5408 | ** 32-bit integer is atomic. |
| 5409 | ** |
| 5410 | ** See Also: [SQLite Shared-Cache Mode] |
| 5411 | */ |
| 5412 | SQLITE_API int SQLITE_STDCALL sqlite3_enable_shared_cache(int); |
| 5413 | |
| 5414 | /* |
| 5415 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5416 | ** |
| 5417 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| @@ -5423,11 +5432,11 @@ | |
| 5423 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5424 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5425 | ** |
| 5426 | ** See also: [sqlite3_db_release_memory()] |
| 5427 | */ |
| 5428 | SQLITE_API int SQLITE_STDCALL sqlite3_release_memory(int); |
| 5429 | |
| 5430 | /* |
| 5431 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5432 | ** METHOD: sqlite3 |
| 5433 | ** |
| @@ -5437,11 +5446,11 @@ | |
| 5437 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5438 | ** omitted. |
| 5439 | ** |
| 5440 | ** See also: [sqlite3_release_memory()] |
| 5441 | */ |
| 5442 | SQLITE_API int SQLITE_STDCALL sqlite3_db_release_memory(sqlite3*); |
| 5443 | |
| 5444 | /* |
| 5445 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5446 | ** |
| 5447 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| @@ -5489,11 +5498,11 @@ | |
| 5489 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5490 | ** |
| 5491 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5492 | ** changes in future releases of SQLite. |
| 5493 | */ |
| 5494 | SQLITE_API sqlite3_int64 SQLITE_STDCALL sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 5495 | |
| 5496 | /* |
| 5497 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5498 | ** DEPRECATED |
| 5499 | ** |
| @@ -5500,11 +5509,11 @@ | |
| 5500 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5501 | ** interface. This routine is provided for historical compatibility |
| 5502 | ** only. All new applications should use the |
| 5503 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5504 | */ |
| 5505 | SQLITE_API SQLITE_DEPRECATED void SQLITE_STDCALL sqlite3_soft_heap_limit(int N); |
| 5506 | |
| 5507 | |
| 5508 | /* |
| 5509 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5510 | ** METHOD: sqlite3 |
| @@ -5570,11 +5579,11 @@ | |
| 5570 | ** |
| 5571 | ** ^This function causes all database schemas to be read from disk and |
| 5572 | ** parsed, if that has not already been done, and returns an error if |
| 5573 | ** any errors are encountered while loading the schema. |
| 5574 | */ |
| 5575 | SQLITE_API int SQLITE_STDCALL sqlite3_table_column_metadata( |
| 5576 | sqlite3 *db, /* Connection handle */ |
| 5577 | const char *zDbName, /* Database name or NULL */ |
| 5578 | const char *zTableName, /* Table name */ |
| 5579 | const char *zColumnName, /* Column name */ |
| 5580 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -5626,11 +5635,11 @@ | |
| 5626 | ** disabled and prevent SQL injections from giving attackers |
| 5627 | ** access to extension loading capabilities. |
| 5628 | ** |
| 5629 | ** See also the [load_extension() SQL function]. |
| 5630 | */ |
| 5631 | SQLITE_API int SQLITE_STDCALL sqlite3_load_extension( |
| 5632 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5633 | const char *zFile, /* Name of the shared library containing extension */ |
| 5634 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5635 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5636 | ); |
| @@ -5658,11 +5667,11 @@ | |
| 5658 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5659 | ** rather than this interface, so the [load_extension()] SQL function |
| 5660 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5661 | ** access to extension loading capabilities. |
| 5662 | */ |
| 5663 | SQLITE_API int SQLITE_STDCALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); |
| 5664 | |
| 5665 | /* |
| 5666 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5667 | ** |
| 5668 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| @@ -5696,11 +5705,14 @@ | |
| 5696 | ** will be called more than once for each database connection that is opened. |
| 5697 | ** |
| 5698 | ** See also: [sqlite3_reset_auto_extension()] |
| 5699 | ** and [sqlite3_cancel_auto_extension()] |
| 5700 | */ |
| 5701 | SQLITE_API int SQLITE_STDCALL sqlite3_auto_extension(void (*xEntryPoint)(void)); |
| 5702 | |
| 5703 | /* |
| 5704 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5705 | ** |
| 5706 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| @@ -5708,19 +5720,21 @@ | |
| 5708 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5709 | ** routine returns 1 if initialization routine X was successfully |
| 5710 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5711 | ** routines. |
| 5712 | */ |
| 5713 | SQLITE_API int SQLITE_STDCALL sqlite3_cancel_auto_extension(void (*xEntryPoint)(void)); |
| 5714 | |
| 5715 | /* |
| 5716 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5717 | ** |
| 5718 | ** ^This interface disables all automatic extensions previously |
| 5719 | ** registered using [sqlite3_auto_extension()]. |
| 5720 | */ |
| 5721 | SQLITE_API void SQLITE_STDCALL sqlite3_reset_auto_extension(void); |
| 5722 | |
| 5723 | /* |
| 5724 | ** The interface to the virtual-table mechanism is currently considered |
| 5725 | ** to be experimental. The interface might change in incompatible ways. |
| 5726 | ** If this is a problem for you, do not use the interface at this time. |
| @@ -5753,41 +5767,41 @@ | |
| 5753 | ** of this structure must not change while it is registered with |
| 5754 | ** any database connection. |
| 5755 | */ |
| 5756 | struct sqlite3_module { |
| 5757 | int iVersion; |
| 5758 | int (*xCreate)(sqlite3*, void *pAux, |
| 5759 | int argc, const char *const*argv, |
| 5760 | sqlite3_vtab **ppVTab, char**); |
| 5761 | int (*xConnect)(sqlite3*, void *pAux, |
| 5762 | int argc, const char *const*argv, |
| 5763 | sqlite3_vtab **ppVTab, char**); |
| 5764 | int (*xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); |
| 5765 | int (*xDisconnect)(sqlite3_vtab *pVTab); |
| 5766 | int (*xDestroy)(sqlite3_vtab *pVTab); |
| 5767 | int (*xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); |
| 5768 | int (*xClose)(sqlite3_vtab_cursor*); |
| 5769 | int (*xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, |
| 5770 | int argc, sqlite3_value **argv); |
| 5771 | int (*xNext)(sqlite3_vtab_cursor*); |
| 5772 | int (*xEof)(sqlite3_vtab_cursor*); |
| 5773 | int (*xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); |
| 5774 | int (*xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); |
| 5775 | int (*xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); |
| 5776 | int (*xBegin)(sqlite3_vtab *pVTab); |
| 5777 | int (*xSync)(sqlite3_vtab *pVTab); |
| 5778 | int (*xCommit)(sqlite3_vtab *pVTab); |
| 5779 | int (*xRollback)(sqlite3_vtab *pVTab); |
| 5780 | int (*xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, |
| 5781 | void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), |
| 5782 | void **ppArg); |
| 5783 | int (*xRename)(sqlite3_vtab *pVtab, const char *zNew); |
| 5784 | /* The methods above are in version 1 of the sqlite_module object. Those |
| 5785 | ** below are for version 2 and greater. */ |
| 5786 | int (*xSavepoint)(sqlite3_vtab *pVTab, int); |
| 5787 | int (*xRelease)(sqlite3_vtab *pVTab, int); |
| 5788 | int (*xRollbackTo)(sqlite3_vtab *pVTab, int); |
| 5789 | }; |
| 5790 | |
| 5791 | /* |
| 5792 | ** CAPI3REF: Virtual Table Indexing Information |
| 5793 | ** KEYWORDS: sqlite3_index_info |
| @@ -5961,22 +5975,22 @@ | |
| 5961 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 5962 | ** ^The sqlite3_create_module() |
| 5963 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 5964 | ** destructor. |
| 5965 | */ |
| 5966 | SQLITE_API int SQLITE_STDCALL sqlite3_create_module( |
| 5967 | sqlite3 *db, /* SQLite connection to register module with */ |
| 5968 | const char *zName, /* Name of the module */ |
| 5969 | const sqlite3_module *p, /* Methods for the module */ |
| 5970 | void *pClientData /* Client data for xCreate/xConnect */ |
| 5971 | ); |
| 5972 | SQLITE_API int SQLITE_STDCALL sqlite3_create_module_v2( |
| 5973 | sqlite3 *db, /* SQLite connection to register module with */ |
| 5974 | const char *zName, /* Name of the module */ |
| 5975 | const sqlite3_module *p, /* Methods for the module */ |
| 5976 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 5977 | void(*xDestroy)(void*) /* Module destructor function */ |
| 5978 | ); |
| 5979 | |
| 5980 | /* |
| 5981 | ** CAPI3REF: Virtual Table Instance Object |
| 5982 | ** KEYWORDS: sqlite3_vtab |
| @@ -6030,11 +6044,11 @@ | |
| 6030 | ** ^The [xCreate] and [xConnect] methods of a |
| 6031 | ** [virtual table module] call this interface |
| 6032 | ** to declare the format (the names and datatypes of the columns) of |
| 6033 | ** the virtual tables they implement. |
| 6034 | */ |
| 6035 | SQLITE_API int SQLITE_STDCALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); |
| 6036 | |
| 6037 | /* |
| 6038 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6039 | ** METHOD: sqlite3 |
| 6040 | ** |
| @@ -6049,11 +6063,11 @@ | |
| 6049 | ** of the new function always causes an exception to be thrown. So |
| 6050 | ** the new function is not good for anything by itself. Its only |
| 6051 | ** purpose is to be a placeholder function that can be overloaded |
| 6052 | ** by a [virtual table]. |
| 6053 | */ |
| 6054 | SQLITE_API int SQLITE_STDCALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 6055 | |
| 6056 | /* |
| 6057 | ** The interface to the virtual-table mechanism defined above (back up |
| 6058 | ** to a comment remarkably similar to this one) is currently considered |
| 6059 | ** to be experimental. The interface might change in incompatible ways. |
| @@ -6148,11 +6162,11 @@ | |
| 6148 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6149 | ** |
| 6150 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6151 | ** be released by a call to [sqlite3_blob_close()]. |
| 6152 | */ |
| 6153 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_open( |
| 6154 | sqlite3*, |
| 6155 | const char *zDb, |
| 6156 | const char *zTable, |
| 6157 | const char *zColumn, |
| 6158 | sqlite3_int64 iRow, |
| @@ -6181,11 +6195,11 @@ | |
| 6181 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6182 | ** always returns zero. |
| 6183 | ** |
| 6184 | ** ^This function sets the database handle error code and message. |
| 6185 | */ |
| 6186 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); |
| 6187 | |
| 6188 | /* |
| 6189 | ** CAPI3REF: Close A BLOB Handle |
| 6190 | ** DESTRUCTOR: sqlite3_blob |
| 6191 | ** |
| @@ -6204,11 +6218,11 @@ | |
| 6204 | ** with a null pointer (such as would be returned by a failed call to |
| 6205 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6206 | ** is passed a valid open blob handle, the values returned by the |
| 6207 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6208 | */ |
| 6209 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_close(sqlite3_blob *); |
| 6210 | |
| 6211 | /* |
| 6212 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6213 | ** METHOD: sqlite3_blob |
| 6214 | ** |
| @@ -6220,11 +6234,11 @@ | |
| 6220 | ** This routine only works on a [BLOB handle] which has been created |
| 6221 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6222 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6223 | ** to this routine results in undefined and probably undesirable behavior. |
| 6224 | */ |
| 6225 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_bytes(sqlite3_blob *); |
| 6226 | |
| 6227 | /* |
| 6228 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6229 | ** METHOD: sqlite3_blob |
| 6230 | ** |
| @@ -6249,11 +6263,11 @@ | |
| 6249 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6250 | ** to this routine results in undefined and probably undesirable behavior. |
| 6251 | ** |
| 6252 | ** See also: [sqlite3_blob_write()]. |
| 6253 | */ |
| 6254 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); |
| 6255 | |
| 6256 | /* |
| 6257 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6258 | ** METHOD: sqlite3_blob |
| 6259 | ** |
| @@ -6291,11 +6305,11 @@ | |
| 6291 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6292 | ** to this routine results in undefined and probably undesirable behavior. |
| 6293 | ** |
| 6294 | ** See also: [sqlite3_blob_read()]. |
| 6295 | */ |
| 6296 | SQLITE_API int SQLITE_STDCALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); |
| 6297 | |
| 6298 | /* |
| 6299 | ** CAPI3REF: Virtual File System Objects |
| 6300 | ** |
| 6301 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| @@ -6322,13 +6336,13 @@ | |
| 6322 | ** |
| 6323 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6324 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6325 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6326 | */ |
| 6327 | SQLITE_API sqlite3_vfs *SQLITE_STDCALL sqlite3_vfs_find(const char *zVfsName); |
| 6328 | SQLITE_API int SQLITE_STDCALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); |
| 6329 | SQLITE_API int SQLITE_STDCALL sqlite3_vfs_unregister(sqlite3_vfs*); |
| 6330 | |
| 6331 | /* |
| 6332 | ** CAPI3REF: Mutexes |
| 6333 | ** |
| 6334 | ** The SQLite core uses these routines for thread |
| @@ -6440,15 +6454,15 @@ | |
| 6440 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6441 | ** behave as no-ops. |
| 6442 | ** |
| 6443 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6444 | */ |
| 6445 | SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_mutex_alloc(int); |
| 6446 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_free(sqlite3_mutex*); |
| 6447 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_enter(sqlite3_mutex*); |
| 6448 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_try(sqlite3_mutex*); |
| 6449 | SQLITE_API void SQLITE_STDCALL sqlite3_mutex_leave(sqlite3_mutex*); |
| 6450 | |
| 6451 | /* |
| 6452 | ** CAPI3REF: Mutex Methods Object |
| 6453 | ** |
| 6454 | ** An instance of this structure defines the low-level routines |
| @@ -6513,19 +6527,19 @@ | |
| 6513 | ** If xMutexInit fails in any way, it is expected to clean up after itself |
| 6514 | ** prior to returning. |
| 6515 | */ |
| 6516 | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; |
| 6517 | struct sqlite3_mutex_methods { |
| 6518 | int (*xMutexInit)(void); |
| 6519 | int (*xMutexEnd)(void); |
| 6520 | sqlite3_mutex *(*xMutexAlloc)(int); |
| 6521 | void (*xMutexFree)(sqlite3_mutex *); |
| 6522 | void (*xMutexEnter)(sqlite3_mutex *); |
| 6523 | int (*xMutexTry)(sqlite3_mutex *); |
| 6524 | void (*xMutexLeave)(sqlite3_mutex *); |
| 6525 | int (*xMutexHeld)(sqlite3_mutex *); |
| 6526 | int (*xMutexNotheld)(sqlite3_mutex *); |
| 6527 | }; |
| 6528 | |
| 6529 | /* |
| 6530 | ** CAPI3REF: Mutex Verification Routines |
| 6531 | ** |
| @@ -6554,12 +6568,12 @@ | |
| 6554 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6555 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6556 | ** interface should also return 1 when given a NULL pointer. |
| 6557 | */ |
| 6558 | #ifndef NDEBUG |
| 6559 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_held(sqlite3_mutex*); |
| 6560 | SQLITE_API int SQLITE_STDCALL sqlite3_mutex_notheld(sqlite3_mutex*); |
| 6561 | #endif |
| 6562 | |
| 6563 | /* |
| 6564 | ** CAPI3REF: Mutex Types |
| 6565 | ** |
| @@ -6595,11 +6609,11 @@ | |
| 6595 | ** serializes access to the [database connection] given in the argument |
| 6596 | ** when the [threading mode] is Serialized. |
| 6597 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6598 | ** routine returns a NULL pointer. |
| 6599 | */ |
| 6600 | SQLITE_API sqlite3_mutex *SQLITE_STDCALL sqlite3_db_mutex(sqlite3*); |
| 6601 | |
| 6602 | /* |
| 6603 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6604 | ** METHOD: sqlite3 |
| 6605 | ** |
| @@ -6630,11 +6644,11 @@ | |
| 6630 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6631 | ** xFileControl method. |
| 6632 | ** |
| 6633 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6634 | */ |
| 6635 | SQLITE_API int SQLITE_STDCALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); |
| 6636 | |
| 6637 | /* |
| 6638 | ** CAPI3REF: Testing Interface |
| 6639 | ** |
| 6640 | ** ^The sqlite3_test_control() interface is used to read out internal |
| @@ -6712,12 +6726,12 @@ | |
| 6712 | ** be represented by a 32-bit integer, then the values returned by |
| 6713 | ** sqlite3_status() are undefined. |
| 6714 | ** |
| 6715 | ** See also: [sqlite3_db_status()] |
| 6716 | */ |
| 6717 | SQLITE_API int SQLITE_STDCALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); |
| 6718 | SQLITE_API int SQLITE_STDCALL sqlite3_status64( |
| 6719 | int op, |
| 6720 | sqlite3_int64 *pCurrent, |
| 6721 | sqlite3_int64 *pHighwater, |
| 6722 | int resetFlag |
| 6723 | ); |
| @@ -6838,11 +6852,11 @@ | |
| 6838 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 6839 | ** non-zero [error code] on failure. |
| 6840 | ** |
| 6841 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 6842 | */ |
| 6843 | SQLITE_API int SQLITE_STDCALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); |
| 6844 | |
| 6845 | /* |
| 6846 | ** CAPI3REF: Status Parameters for database connections |
| 6847 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 6848 | ** |
| @@ -6981,11 +6995,11 @@ | |
| 6981 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 6982 | ** interface call returns. |
| 6983 | ** |
| 6984 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 6985 | */ |
| 6986 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); |
| 6987 | |
| 6988 | /* |
| 6989 | ** CAPI3REF: Status Parameters for prepared statements |
| 6990 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 6991 | ** |
| @@ -7217,22 +7231,22 @@ | |
| 7217 | */ |
| 7218 | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; |
| 7219 | struct sqlite3_pcache_methods2 { |
| 7220 | int iVersion; |
| 7221 | void *pArg; |
| 7222 | int (*xInit)(void*); |
| 7223 | void (*xShutdown)(void*); |
| 7224 | sqlite3_pcache *(*xCreate)(int szPage, int szExtra, int bPurgeable); |
| 7225 | void (*xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7226 | int (*xPagecount)(sqlite3_pcache*); |
| 7227 | sqlite3_pcache_page *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7228 | void (*xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); |
| 7229 | void (*xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, |
| 7230 | unsigned oldKey, unsigned newKey); |
| 7231 | void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7232 | void (*xDestroy)(sqlite3_pcache*); |
| 7233 | void (*xShrink)(sqlite3_pcache*); |
| 7234 | }; |
| 7235 | |
| 7236 | /* |
| 7237 | ** This is the obsolete pcache_methods object that has now been replaced |
| 7238 | ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is |
| @@ -7239,20 +7253,20 @@ | |
| 7239 | ** retained in the header file for backwards compatibility only. |
| 7240 | */ |
| 7241 | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; |
| 7242 | struct sqlite3_pcache_methods { |
| 7243 | void *pArg; |
| 7244 | int (*xInit)(void*); |
| 7245 | void (*xShutdown)(void*); |
| 7246 | sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); |
| 7247 | void (*xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7248 | int (*xPagecount)(sqlite3_pcache*); |
| 7249 | void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7250 | void (*xUnpin)(sqlite3_pcache*, void*, int discard); |
| 7251 | void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); |
| 7252 | void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7253 | void (*xDestroy)(sqlite3_pcache*); |
| 7254 | }; |
| 7255 | |
| 7256 | |
| 7257 | /* |
| 7258 | ** CAPI3REF: Online Backup Object |
| @@ -7450,20 +7464,20 @@ | |
| 7450 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7451 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7452 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7453 | ** possible that they return invalid values. |
| 7454 | */ |
| 7455 | SQLITE_API sqlite3_backup *SQLITE_STDCALL sqlite3_backup_init( |
| 7456 | sqlite3 *pDest, /* Destination database handle */ |
| 7457 | const char *zDestName, /* Destination database name */ |
| 7458 | sqlite3 *pSource, /* Source database handle */ |
| 7459 | const char *zSourceName /* Source database name */ |
| 7460 | ); |
| 7461 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_step(sqlite3_backup *p, int nPage); |
| 7462 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_finish(sqlite3_backup *p); |
| 7463 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_remaining(sqlite3_backup *p); |
| 7464 | SQLITE_API int SQLITE_STDCALL sqlite3_backup_pagecount(sqlite3_backup *p); |
| 7465 | |
| 7466 | /* |
| 7467 | ** CAPI3REF: Unlock Notification |
| 7468 | ** METHOD: sqlite3 |
| 7469 | ** |
| @@ -7576,13 +7590,13 @@ | |
| 7576 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7577 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7578 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7579 | ** SQLITE_LOCKED.)^ |
| 7580 | */ |
| 7581 | SQLITE_API int SQLITE_STDCALL sqlite3_unlock_notify( |
| 7582 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7583 | void (*xNotify)(void **apArg, int nArg), /* Callback function to invoke */ |
| 7584 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7585 | ); |
| 7586 | |
| 7587 | |
| 7588 | /* |
| @@ -7591,12 +7605,12 @@ | |
| 7591 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7592 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7593 | ** strings in a case-independent fashion, using the same definition of "case |
| 7594 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7595 | */ |
| 7596 | SQLITE_API int SQLITE_STDCALL sqlite3_stricmp(const char *, const char *); |
| 7597 | SQLITE_API int SQLITE_STDCALL sqlite3_strnicmp(const char *, const char *, int); |
| 7598 | |
| 7599 | /* |
| 7600 | ** CAPI3REF: String Globbing |
| 7601 | * |
| 7602 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| @@ -7609,11 +7623,11 @@ | |
| 7609 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7610 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7611 | ** |
| 7612 | ** See also: [sqlite3_strlike()]. |
| 7613 | */ |
| 7614 | SQLITE_API int SQLITE_STDCALL sqlite3_strglob(const char *zGlob, const char *zStr); |
| 7615 | |
| 7616 | /* |
| 7617 | ** CAPI3REF: String LIKE Matching |
| 7618 | * |
| 7619 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| @@ -7632,11 +7646,11 @@ | |
| 7632 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7633 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7634 | ** |
| 7635 | ** See also: [sqlite3_strglob()]. |
| 7636 | */ |
| 7637 | SQLITE_API int SQLITE_STDCALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); |
| 7638 | |
| 7639 | /* |
| 7640 | ** CAPI3REF: Error Logging Interface |
| 7641 | ** |
| 7642 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| @@ -7691,13 +7705,13 @@ | |
| 7691 | ** previously registered write-ahead log callback. ^Note that the |
| 7692 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7693 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7694 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7695 | */ |
| 7696 | SQLITE_API void *SQLITE_STDCALL sqlite3_wal_hook( |
| 7697 | sqlite3*, |
| 7698 | int(*)(void *,sqlite3*,const char*,int), |
| 7699 | void* |
| 7700 | ); |
| 7701 | |
| 7702 | /* |
| 7703 | ** CAPI3REF: Configure an auto-checkpoint |
| @@ -7726,11 +7740,11 @@ | |
| 7726 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 7727 | ** pages. The use of this interface |
| 7728 | ** is only necessary if the default setting is found to be suboptimal |
| 7729 | ** for a particular application. |
| 7730 | */ |
| 7731 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); |
| 7732 | |
| 7733 | /* |
| 7734 | ** CAPI3REF: Checkpoint a database |
| 7735 | ** METHOD: sqlite3 |
| 7736 | ** |
| @@ -7748,11 +7762,11 @@ | |
| 7748 | ** interface was added. This interface is retained for backwards |
| 7749 | ** compatibility and as a convenience for applications that need to manually |
| 7750 | ** start a callback but which do not need the full power (and corresponding |
| 7751 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 7752 | */ |
| 7753 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); |
| 7754 | |
| 7755 | /* |
| 7756 | ** CAPI3REF: Checkpoint a database |
| 7757 | ** METHOD: sqlite3 |
| 7758 | ** |
| @@ -7842,11 +7856,11 @@ | |
| 7842 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 7843 | ** |
| 7844 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 7845 | ** from SQL. |
| 7846 | */ |
| 7847 | SQLITE_API int SQLITE_STDCALL sqlite3_wal_checkpoint_v2( |
| 7848 | sqlite3 *db, /* Database handle */ |
| 7849 | const char *zDb, /* Name of attached database (or NULL) */ |
| 7850 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 7851 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 7852 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -7931,11 +7945,11 @@ | |
| 7931 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 7932 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 7933 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 7934 | ** [virtual table]. |
| 7935 | */ |
| 7936 | SQLITE_API int SQLITE_STDCALL sqlite3_vtab_on_conflict(sqlite3 *); |
| 7937 | |
| 7938 | /* |
| 7939 | ** CAPI3REF: Conflict resolution modes |
| 7940 | ** KEYWORDS: {conflict resolution mode} |
| 7941 | ** |
| @@ -8036,11 +8050,11 @@ | |
| 8036 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8037 | ** that pOut points to unchanged. |
| 8038 | ** |
| 8039 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8040 | */ |
| 8041 | SQLITE_API int SQLITE_STDCALL sqlite3_stmt_scanstatus( |
| 8042 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8043 | int idx, /* Index of loop to report on */ |
| 8044 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8045 | void *pOut /* Result written here */ |
| 8046 | ); |
| @@ -8052,11 +8066,11 @@ | |
| 8052 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8053 | ** |
| 8054 | ** This API is only available if the library is built with pre-processor |
| 8055 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8056 | */ |
| 8057 | SQLITE_API void SQLITE_STDCALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); |
| 8058 | |
| 8059 | /* |
| 8060 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8061 | ** |
| 8062 | ** ^If a write-transaction is open on [database connection] D when the |
| @@ -8084,11 +8098,11 @@ | |
| 8084 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8085 | ** |
| 8086 | ** ^This function does not set the database handle error code or message |
| 8087 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8088 | */ |
| 8089 | SQLITE_API int SQLITE_STDCALL sqlite3_db_cacheflush(sqlite3*); |
| 8090 | |
| 8091 | /* |
| 8092 | ** CAPI3REF: The pre-update hook. |
| 8093 | ** |
| 8094 | ** ^These interfaces are only available if SQLite is compiled using the |
| @@ -8164,13 +8178,13 @@ | |
| 8164 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8165 | ** triggers; and so forth. |
| 8166 | ** |
| 8167 | ** See also: [sqlite3_update_hook()] |
| 8168 | */ |
| 8169 | SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_STDCALL sqlite3_preupdate_hook( |
| 8170 | sqlite3 *db, |
| 8171 | void(*xPreUpdate)( |
| 8172 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8173 | sqlite3 *db, /* Database handle */ |
| 8174 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| 8175 | char const *zDb, /* Database name */ |
| 8176 | char const *zName, /* Table name */ |
| @@ -8177,14 +8191,14 @@ | |
| 8177 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8178 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8179 | ), |
| 8180 | void* |
| 8181 | ); |
| 8182 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); |
| 8183 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_count(sqlite3 *); |
| 8184 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_depth(sqlite3 *); |
| 8185 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 8186 | |
| 8187 | /* |
| 8188 | ** CAPI3REF: Low-level system error code |
| 8189 | ** |
| 8190 | ** ^Attempt to return the underlying operating system error code or error |
| @@ -8192,11 +8206,11 @@ | |
| 8192 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8193 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8194 | ** called to get back the underlying "errno" that caused the problem, such |
| 8195 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8196 | */ |
| 8197 | SQLITE_API int SQLITE_STDCALL sqlite3_system_errno(sqlite3*); |
| 8198 | |
| 8199 | /* |
| 8200 | ** CAPI3REF: Database Snapshot |
| 8201 | ** KEYWORDS: {snapshot} |
| 8202 | ** EXPERIMENTAL |
| @@ -8242,11 +8256,11 @@ | |
| 8242 | ** to avoid a memory leak. |
| 8243 | ** |
| 8244 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8245 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8246 | */ |
| 8247 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_get( |
| 8248 | sqlite3 *db, |
| 8249 | const char *zSchema, |
| 8250 | sqlite3_snapshot **ppSnapshot |
| 8251 | ); |
| 8252 | |
| @@ -8280,11 +8294,11 @@ | |
| 8280 | ** database connection in order to make it ready to use snapshots.) |
| 8281 | ** |
| 8282 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8283 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8284 | */ |
| 8285 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_open( |
| 8286 | sqlite3 *db, |
| 8287 | const char *zSchema, |
| 8288 | sqlite3_snapshot *pSnapshot |
| 8289 | ); |
| 8290 | |
| @@ -8297,11 +8311,11 @@ | |
| 8297 | ** using this routine to avoid a memory leak. |
| 8298 | ** |
| 8299 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8300 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8301 | */ |
| 8302 | SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_STDCALL sqlite3_snapshot_free(sqlite3_snapshot*); |
| 8303 | |
| 8304 | /* |
| 8305 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8306 | ** EXPERIMENTAL |
| 8307 | ** |
| @@ -8321,11 +8335,11 @@ | |
| 8321 | ** |
| 8322 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8323 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8324 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8325 | */ |
| 8326 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_STDCALL sqlite3_snapshot_cmp( |
| 8327 | sqlite3_snapshot *p1, |
| 8328 | sqlite3_snapshot *p2 |
| 8329 | ); |
| 8330 | |
| 8331 | /* |
| @@ -8379,14 +8393,14 @@ | |
| 8379 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8380 | ** R-Tree geometry query as follows: |
| 8381 | ** |
| 8382 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8383 | */ |
| 8384 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_geometry_callback( |
| 8385 | sqlite3 *db, |
| 8386 | const char *zGeom, |
| 8387 | int (*xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), |
| 8388 | void *pContext |
| 8389 | ); |
| 8390 | |
| 8391 | |
| 8392 | /* |
| @@ -8396,25 +8410,25 @@ | |
| 8396 | struct sqlite3_rtree_geometry { |
| 8397 | void *pContext; /* Copy of pContext passed to s_r_g_c() */ |
| 8398 | int nParam; /* Size of array aParam[] */ |
| 8399 | sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ |
| 8400 | void *pUser; /* Callback implementation user data */ |
| 8401 | void (*xDelUser)(void *); /* Called by SQLite to clean up pUser */ |
| 8402 | }; |
| 8403 | |
| 8404 | /* |
| 8405 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8406 | ** used as part of an R-Tree geometry query as follows: |
| 8407 | ** |
| 8408 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8409 | */ |
| 8410 | SQLITE_API int SQLITE_STDCALL sqlite3_rtree_query_callback( |
| 8411 | sqlite3 *db, |
| 8412 | const char *zQueryFunc, |
| 8413 | int (*xQueryFunc)(sqlite3_rtree_query_info*), |
| 8414 | void *pContext, |
| 8415 | void (*xDestructor)(void*) |
| 8416 | ); |
| 8417 | |
| 8418 | |
| 8419 | /* |
| 8420 | ** A pointer to a structure of the following type is passed as the |
| @@ -8428,11 +8442,11 @@ | |
| 8428 | struct sqlite3_rtree_query_info { |
| 8429 | void *pContext; /* pContext from when function registered */ |
| 8430 | int nParam; /* Number of function parameters */ |
| 8431 | sqlite3_rtree_dbl *aParam; /* value of function parameters */ |
| 8432 | void *pUser; /* callback can use this, if desired */ |
| 8433 | void (*xDelUser)(void*); /* function to free pUser */ |
| 8434 | sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ |
| 8435 | unsigned int *anQueue; /* Number of pending entries in the queue */ |
| 8436 | int nCoord; /* Number of coordinates */ |
| 8437 | int iLevel; /* Level of current node or entry */ |
| 8438 | int mxLevel; /* The largest iLevel value in the tree */ |
| @@ -8624,11 +8638,11 @@ | |
| 8624 | ** If xFilter returns 0, changes is not tracked. Note that once a table is |
| 8625 | ** attached, xFilter will not be called again. |
| 8626 | */ |
| 8627 | void sqlite3session_table_filter( |
| 8628 | sqlite3_session *pSession, /* Session object */ |
| 8629 | int(*xFilter)( |
| 8630 | void *pCtx, /* Copy of third arg to _filter_table() */ |
| 8631 | const char *zTab /* Table name */ |
| 8632 | ), |
| 8633 | void *pCtx /* First argument passed to xFilter */ |
| 8634 | ); |
| @@ -9199,11 +9213,11 @@ | |
| 9199 | ** An sqlite3_changegroup object is used to combine two or more changesets |
| 9200 | ** (or patchsets) into a single changeset (or patchset). A single changegroup |
| 9201 | ** object may combine changesets or patchsets, but not both. The output is |
| 9202 | ** always in the same format as the input. |
| 9203 | ** |
| 9204 | ** If successful, this function returns SQLITE_OK and populates (*pp) with |
| 9205 | ** a pointer to a new sqlite3_changegroup object before returning. The caller |
| 9206 | ** should eventually free the returned object using a call to |
| 9207 | ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code |
| 9208 | ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. |
| 9209 | ** |
| @@ -9319,11 +9333,11 @@ | |
| 9319 | ** changes for tables that do not appear in the first changeset, they are |
| 9320 | ** appended onto the end of the output changeset, again in the order in |
| 9321 | ** which they are first encountered. |
| 9322 | ** |
| 9323 | ** If an error occurs, an SQLite error code is returned and the output |
| 9324 | ** variables (*pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK |
| 9325 | ** is returned and the output variables are set to the size of and a |
| 9326 | ** pointer to the output buffer, respectively. In this case it is the |
| 9327 | ** responsibility of the caller to eventually free the buffer using a |
| 9328 | ** call to sqlite3_free(). |
| 9329 | */ |
| @@ -9476,15 +9490,15 @@ | |
| 9476 | */ |
| 9477 | int sqlite3changeset_apply( |
| 9478 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9479 | int nChangeset, /* Size of changeset in bytes */ |
| 9480 | void *pChangeset, /* Changeset blob */ |
| 9481 | int(*xFilter)( |
| 9482 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9483 | const char *zTab /* Table name */ |
| 9484 | ), |
| 9485 | int(*xConflict)( |
| 9486 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9487 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9488 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9489 | ), |
| 9490 | void *pCtx /* First argument passed to xConflict */ |
| @@ -9621,20 +9635,20 @@ | |
| 9621 | ** </pre> |
| 9622 | ** |
| 9623 | ** Is replaced by: |
| 9624 | ** |
| 9625 | ** <pre> |
| 9626 | ** int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9627 | ** void *pIn, |
| 9628 | ** </pre> |
| 9629 | ** |
| 9630 | ** Each time the xInput callback is invoked by the sessions module, the first |
| 9631 | ** argument passed is a copy of the supplied pIn context pointer. The second |
| 9632 | ** argument, pData, points to a buffer (*pnData) bytes in size. Assuming no |
| 9633 | ** error occurs the xInput method should copy up to (*pnData) bytes of data |
| 9634 | ** into the buffer and set (*pnData) to the actual number of bytes copied |
| 9635 | ** before returning SQLITE_OK. If the input is completely exhausted, (*pnData) |
| 9636 | ** should be set to zero to indicate this. Or, if an error occurs, an SQLite |
| 9637 | ** error code should be returned. In all cases, if an xInput callback returns |
| 9638 | ** an error, all processing is abandoned and the streaming API function |
| 9639 | ** returns a copy of the error code to the caller. |
| 9640 | ** |
| @@ -9655,11 +9669,11 @@ | |
| 9655 | ** </pre> |
| 9656 | ** |
| 9657 | ** Is replaced by: |
| 9658 | ** |
| 9659 | ** <pre> |
| 9660 | ** int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9661 | ** void *pOut |
| 9662 | ** </pre> |
| 9663 | ** |
| 9664 | ** The xOutput callback is invoked zero or more times to return data to |
| 9665 | ** the application. The first parameter passed to each call is a copy of the |
| @@ -9675,58 +9689,58 @@ | |
| 9675 | ** parameter set to a value less than or equal to zero. Other than this, |
| 9676 | ** no guarantees are made as to the size of the chunks of data returned. |
| 9677 | */ |
| 9678 | int sqlite3changeset_apply_strm( |
| 9679 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9680 | int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 9681 | void *pIn, /* First arg for xInput */ |
| 9682 | int(*xFilter)( |
| 9683 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9684 | const char *zTab /* Table name */ |
| 9685 | ), |
| 9686 | int(*xConflict)( |
| 9687 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9688 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9689 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9690 | ), |
| 9691 | void *pCtx /* First argument passed to xConflict */ |
| 9692 | ); |
| 9693 | int sqlite3changeset_concat_strm( |
| 9694 | int (*xInputA)(void *pIn, void *pData, int *pnData), |
| 9695 | void *pInA, |
| 9696 | int (*xInputB)(void *pIn, void *pData, int *pnData), |
| 9697 | void *pInB, |
| 9698 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9699 | void *pOut |
| 9700 | ); |
| 9701 | int sqlite3changeset_invert_strm( |
| 9702 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9703 | void *pIn, |
| 9704 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9705 | void *pOut |
| 9706 | ); |
| 9707 | int sqlite3changeset_start_strm( |
| 9708 | sqlite3_changeset_iter **pp, |
| 9709 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9710 | void *pIn |
| 9711 | ); |
| 9712 | int sqlite3session_changeset_strm( |
| 9713 | sqlite3_session *pSession, |
| 9714 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9715 | void *pOut |
| 9716 | ); |
| 9717 | int sqlite3session_patchset_strm( |
| 9718 | sqlite3_session *pSession, |
| 9719 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9720 | void *pOut |
| 9721 | ); |
| 9722 | int sqlite3changegroup_add_strm(sqlite3_changegroup*, |
| 9723 | int (*xInput)(void *pIn, void *pData, int *pnData), |
| 9724 | void *pIn |
| 9725 | ); |
| 9726 | int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 9727 | int (*xOutput)(void *pOut, const void *pData, int nData), |
| 9728 | void *pOut |
| 9729 | ); |
| 9730 | |
| 9731 | |
| 9732 | /* |
| @@ -9777,11 +9791,11 @@ | |
| 9777 | |
| 9778 | typedef struct Fts5ExtensionApi Fts5ExtensionApi; |
| 9779 | typedef struct Fts5Context Fts5Context; |
| 9780 | typedef struct Fts5PhraseIter Fts5PhraseIter; |
| 9781 | |
| 9782 | typedef void (*fts5_extension_function)( |
| 9783 | const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ |
| 9784 | Fts5Context *pFts, /* First arg to pass to pApi functions */ |
| 9785 | sqlite3_context *pCtx, /* Context for returning result/error */ |
| 9786 | int nVal, /* Number of values in apVal[] array */ |
| 9787 | sqlite3_value **apVal /* Array of trailing arguments */ |
| @@ -9828,15 +9842,15 @@ | |
| 9828 | ** This function may be quite inefficient if used with an FTS5 table |
| 9829 | ** created with the "columnsize=0" option. |
| 9830 | ** |
| 9831 | ** xColumnText: |
| 9832 | ** This function attempts to retrieve the text of column iCol of the |
| 9833 | ** current document. If successful, (*pz) is set to point to a buffer |
| 9834 | ** containing the text in utf-8 encoding, (*pn) is set to the size in bytes |
| 9835 | ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, |
| 9836 | ** if an error occurs, an SQLite error code is returned and the final values |
| 9837 | ** of (*pz) and (*pn) are undefined. |
| 9838 | ** |
| 9839 | ** xPhraseCount: |
| 9840 | ** Returns the number of phrases in the current query expression. |
| 9841 | ** |
| 9842 | ** xPhraseSize: |
| @@ -9941,11 +9955,11 @@ | |
| 9941 | ** xRowCount(pFts5, pnRow) |
| 9942 | ** |
| 9943 | ** This function is used to retrieve the total number of rows in the table. |
| 9944 | ** In other words, the same value that would be returned by: |
| 9945 | ** |
| 9946 | ** SELECT count(*) FROM ftstable; |
| 9947 | ** |
| 9948 | ** xPhraseFirst() |
| 9949 | ** This function is used, along with type Fts5PhraseIter and the xPhraseNext |
| 9950 | ** method, to iterate through all instances of a single query phrase within |
| 9951 | ** the current row. This is the same information as is accessible via the |
| @@ -10008,43 +10022,43 @@ | |
| 10008 | ** See xPhraseFirstColumn above. |
| 10009 | */ |
| 10010 | struct Fts5ExtensionApi { |
| 10011 | int iVersion; /* Currently always set to 3 */ |
| 10012 | |
| 10013 | void *(*xUserData)(Fts5Context*); |
| 10014 | |
| 10015 | int (*xColumnCount)(Fts5Context*); |
| 10016 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 10017 | int (*xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); |
| 10018 | |
| 10019 | int (*xTokenize)(Fts5Context*, |
| 10020 | const char *pText, int nText, /* Text to tokenize */ |
| 10021 | void *pCtx, /* Context passed to xToken() */ |
| 10022 | int (*xToken)(void*, int, const char*, int, int, int) /* Callback */ |
| 10023 | ); |
| 10024 | |
| 10025 | int (*xPhraseCount)(Fts5Context*); |
| 10026 | int (*xPhraseSize)(Fts5Context*, int iPhrase); |
| 10027 | |
| 10028 | int (*xInstCount)(Fts5Context*, int *pnInst); |
| 10029 | int (*xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); |
| 10030 | |
| 10031 | sqlite3_int64 (*xRowid)(Fts5Context*); |
| 10032 | int (*xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); |
| 10033 | int (*xColumnSize)(Fts5Context*, int iCol, int *pnToken); |
| 10034 | |
| 10035 | int (*xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, |
| 10036 | int(*)(const Fts5ExtensionApi*,Fts5Context*,void*) |
| 10037 | ); |
| 10038 | int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); |
| 10039 | void *(*xGetAuxdata)(Fts5Context*, int bClear); |
| 10040 | |
| 10041 | int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); |
| 10042 | void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); |
| 10043 | |
| 10044 | int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); |
| 10045 | void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); |
| 10046 | }; |
| 10047 | |
| 10048 | /* |
| 10049 | ** CUSTOM AUXILIARY FUNCTIONS |
| 10050 | *************************************************************************/ |
| @@ -10068,11 +10082,11 @@ | |
| 10068 | ** The second and third arguments are an array of nul-terminated strings |
| 10069 | ** containing the tokenizer arguments, if any, specified following the |
| 10070 | ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used |
| 10071 | ** to create the FTS5 table. |
| 10072 | ** |
| 10073 | ** The final argument is an output variable. If successful, (*ppOut) |
| 10074 | ** should be set to point to the new tokenizer handle and SQLITE_OK |
| 10075 | ** returned. If an error occurs, some value other than SQLITE_OK should |
| 10076 | ** be returned. In this case, fts5 assumes that the final value of *ppOut |
| 10077 | ** is undefined. |
| 10078 | ** |
| @@ -10242,17 +10256,17 @@ | |
| 10242 | ** inefficient. |
| 10243 | */ |
| 10244 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| 10245 | typedef struct fts5_tokenizer fts5_tokenizer; |
| 10246 | struct fts5_tokenizer { |
| 10247 | int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); |
| 10248 | void (*xDelete)(Fts5Tokenizer*); |
| 10249 | int (*xTokenize)(Fts5Tokenizer*, |
| 10250 | void *pCtx, |
| 10251 | int flags, /* Mask of FTS5_TOKENIZE_* flags */ |
| 10252 | const char *pText, int nText, |
| 10253 | int (*xToken)( |
| 10254 | void *pCtx, /* Copy of 2nd argument to xTokenize() */ |
| 10255 | int tflags, /* Mask of FTS5_TOKEN_* flags */ |
| 10256 | const char *pToken, /* Pointer to buffer containing token */ |
| 10257 | int nToken, /* Size of token in bytes */ |
| 10258 | int iStart, /* Byte offset of token within input text */ |
| @@ -10281,33 +10295,33 @@ | |
| 10281 | typedef struct fts5_api fts5_api; |
| 10282 | struct fts5_api { |
| 10283 | int iVersion; /* Currently always set to 2 */ |
| 10284 | |
| 10285 | /* Create a new tokenizer */ |
| 10286 | int (*xCreateTokenizer)( |
| 10287 | fts5_api *pApi, |
| 10288 | const char *zName, |
| 10289 | void *pContext, |
| 10290 | fts5_tokenizer *pTokenizer, |
| 10291 | void (*xDestroy)(void*) |
| 10292 | ); |
| 10293 | |
| 10294 | /* Find an existing tokenizer */ |
| 10295 | int (*xFindTokenizer)( |
| 10296 | fts5_api *pApi, |
| 10297 | const char *zName, |
| 10298 | void **ppContext, |
| 10299 | fts5_tokenizer *pTokenizer |
| 10300 | ); |
| 10301 | |
| 10302 | /* Create a new auxiliary function */ |
| 10303 | int (*xCreateFunction)( |
| 10304 | fts5_api *pApi, |
| 10305 | const char *zName, |
| 10306 | void *pContext, |
| 10307 | fts5_extension_function xFunction, |
| 10308 | void (*xDestroy)(void*) |
| 10309 | ); |
| 10310 | }; |
| 10311 | |
| 10312 | /* |
| 10313 | ** END OF REGISTRATION API |
| 10314 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -52,12 +52,21 @@ | |
| 52 | # define SQLITE_API |
| 53 | #endif |
| 54 | #ifndef SQLITE_CDECL |
| 55 | # define SQLITE_CDECL |
| 56 | #endif |
| 57 | #ifndef SQLITE_APICALL |
| 58 | # define SQLITE_APICALL |
| 59 | #endif |
| 60 | #ifndef SQLITE_STDCALL |
| 61 | # define SQLITE_STDCALL SQLITE_APICALL |
| 62 | #endif |
| 63 | #ifndef SQLITE_CALLBACK |
| 64 | # define SQLITE_CALLBACK |
| 65 | #endif |
| 66 | #ifndef SQLITE_SYSAPI |
| 67 | # define SQLITE_SYSAPI |
| 68 | #endif |
| 69 | |
| 70 | /* |
| 71 | ** These no-op macros are used in front of interfaces to mark those |
| 72 | ** interfaces as either deprecated or experimental. New applications |
| @@ -111,11 +120,11 @@ | |
| 120 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 121 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 122 | */ |
| 123 | #define SQLITE_VERSION "3.14.0" |
| 124 | #define SQLITE_VERSION_NUMBER 3014000 |
| 125 | #define SQLITE_SOURCE_ID "2016-07-29 04:12:18 544c990afd3b64064cc4d970ec5d7eb23eeb9914" |
| 126 | |
| 127 | /* |
| 128 | ** CAPI3REF: Run-Time Library Version Numbers |
| 129 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 130 | ** |
| @@ -144,13 +153,13 @@ | |
| 153 | ** [SQLITE_SOURCE_ID] C preprocessor macro. |
| 154 | ** |
| 155 | ** See also: [sqlite_version()] and [sqlite_source_id()]. |
| 156 | */ |
| 157 | SQLITE_API SQLITE_EXTERN const char sqlite3_version[]; |
| 158 | SQLITE_API const char *SQLITE_APICALL sqlite3_libversion(void); |
| 159 | SQLITE_API const char *SQLITE_APICALL sqlite3_sourceid(void); |
| 160 | SQLITE_API int SQLITE_APICALL sqlite3_libversion_number(void); |
| 161 | |
| 162 | /* |
| 163 | ** CAPI3REF: Run-Time Library Compilation Options Diagnostics |
| 164 | ** |
| 165 | ** ^The sqlite3_compileoption_used() function returns 0 or 1 |
| @@ -171,12 +180,12 @@ | |
| 180 | ** |
| 181 | ** See also: SQL functions [sqlite_compileoption_used()] and |
| 182 | ** [sqlite_compileoption_get()] and the [compile_options pragma]. |
| 183 | */ |
| 184 | #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS |
| 185 | SQLITE_API int SQLITE_APICALL sqlite3_compileoption_used(const char *zOptName); |
| 186 | SQLITE_API const char *SQLITE_APICALL sqlite3_compileoption_get(int N); |
| 187 | #endif |
| 188 | |
| 189 | /* |
| 190 | ** CAPI3REF: Test To See If The Library Is Threadsafe |
| 191 | ** |
| @@ -211,11 +220,11 @@ | |
| 220 | ** sqlite3_config(). In other words, the return value from sqlite3_threadsafe() |
| 221 | ** is unchanged by calls to sqlite3_config().)^ |
| 222 | ** |
| 223 | ** See the [threading mode] documentation for additional information. |
| 224 | */ |
| 225 | SQLITE_API int SQLITE_APICALL sqlite3_threadsafe(void); |
| 226 | |
| 227 | /* |
| 228 | ** CAPI3REF: Database Connection Handle |
| 229 | ** KEYWORDS: {database connection} {database connections} |
| 230 | ** |
| @@ -308,19 +317,19 @@ | |
| 317 | ** from [sqlite3_open()], [sqlite3_open16()], or |
| 318 | ** [sqlite3_open_v2()], and not previously closed. |
| 319 | ** ^Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer |
| 320 | ** argument is a harmless no-op. |
| 321 | */ |
| 322 | SQLITE_API int SQLITE_APICALL sqlite3_close(sqlite3*); |
| 323 | SQLITE_API int SQLITE_APICALL sqlite3_close_v2(sqlite3*); |
| 324 | |
| 325 | /* |
| 326 | ** The type for a callback function. |
| 327 | ** This is legacy and deprecated. It is included for historical |
| 328 | ** compatibility and is not documented. |
| 329 | */ |
| 330 | typedef int (SQLITE_CALLBACK *sqlite3_callback)(void*,int,char**, char**); |
| 331 | |
| 332 | /* |
| 333 | ** CAPI3REF: One-Step Query Execution Interface |
| 334 | ** METHOD: sqlite3 |
| 335 | ** |
| @@ -380,14 +389,14 @@ | |
| 389 | ** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running. |
| 390 | ** <li> The application must not modify the SQL statement text passed into |
| 391 | ** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running. |
| 392 | ** </ul> |
| 393 | */ |
| 394 | SQLITE_API int SQLITE_APICALL sqlite3_exec( |
| 395 | sqlite3*, /* An open database */ |
| 396 | const char *sql, /* SQL to be evaluated */ |
| 397 | int (SQLITE_CALLBACK *callback)(void*,int,char**,char**), /* Callback function */ |
| 398 | void *, /* 1st argument to callback */ |
| 399 | char **errmsg /* Error msg written here */ |
| 400 | ); |
| 401 | |
| 402 | /* |
| @@ -731,30 +740,30 @@ | |
| 740 | ** database corruption. |
| 741 | */ |
| 742 | typedef struct sqlite3_io_methods sqlite3_io_methods; |
| 743 | struct sqlite3_io_methods { |
| 744 | int iVersion; |
| 745 | int (SQLITE_CALLBACK *xClose)(sqlite3_file*); |
| 746 | int (SQLITE_CALLBACK *xRead)(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); |
| 747 | int (SQLITE_CALLBACK *xWrite)(sqlite3_file*, const void*, int iAmt, sqlite3_int64 iOfst); |
| 748 | int (SQLITE_CALLBACK *xTruncate)(sqlite3_file*, sqlite3_int64 size); |
| 749 | int (SQLITE_CALLBACK *xSync)(sqlite3_file*, int flags); |
| 750 | int (SQLITE_CALLBACK *xFileSize)(sqlite3_file*, sqlite3_int64 *pSize); |
| 751 | int (SQLITE_CALLBACK *xLock)(sqlite3_file*, int); |
| 752 | int (SQLITE_CALLBACK *xUnlock)(sqlite3_file*, int); |
| 753 | int (SQLITE_CALLBACK *xCheckReservedLock)(sqlite3_file*, int *pResOut); |
| 754 | int (SQLITE_CALLBACK *xFileControl)(sqlite3_file*, int op, void *pArg); |
| 755 | int (SQLITE_CALLBACK *xSectorSize)(sqlite3_file*); |
| 756 | int (SQLITE_CALLBACK *xDeviceCharacteristics)(sqlite3_file*); |
| 757 | /* Methods above are valid for version 1 */ |
| 758 | int (SQLITE_CALLBACK *xShmMap)(sqlite3_file*, int iPg, int pgsz, int, void volatile**); |
| 759 | int (SQLITE_CALLBACK *xShmLock)(sqlite3_file*, int offset, int n, int flags); |
| 760 | void (SQLITE_CALLBACK *xShmBarrier)(sqlite3_file*); |
| 761 | int (SQLITE_CALLBACK *xShmUnmap)(sqlite3_file*, int deleteFlag); |
| 762 | /* Methods above are valid for version 2 */ |
| 763 | int (SQLITE_CALLBACK *xFetch)(sqlite3_file*, sqlite3_int64 iOfst, int iAmt, void **pp); |
| 764 | int (SQLITE_CALLBACK *xUnfetch)(sqlite3_file*, sqlite3_int64 iOfst, void *p); |
| 765 | /* Methods above are valid for version 3 */ |
| 766 | /* Additional methods may be added in future releases */ |
| 767 | }; |
| 768 | |
| 769 | /* |
| @@ -926,11 +935,11 @@ | |
| 935 | ** ^The [SQLITE_FCNTL_BUSYHANDLER] |
| 936 | ** file-control may be invoked by SQLite on the database file handle |
| 937 | ** shortly after it is opened in order to provide a custom VFS with access |
| 938 | ** to the connections busy-handler callback. The argument is of type (void **) |
| 939 | ** - an array of two (void *) values. The first (void *) actually points |
| 940 | ** to a function of type (int (SQLITE_CALLBACK *)(void *)). In order to invoke the connections |
| 941 | ** busy-handler, this function should be invoked with the second (void *) in |
| 942 | ** the array as the only argument. If it returns non-zero, then the operation |
| 943 | ** should be retried. If it returns zero, the custom VFS should abandon the |
| 944 | ** current operation. |
| 945 | ** |
| @@ -1192,43 +1201,43 @@ | |
| 1201 | ** or all of these interfaces to be NULL or for their behavior to change |
| 1202 | ** from one release to the next. Applications must not attempt to access |
| 1203 | ** any of these methods if the iVersion of the VFS is less than 3. |
| 1204 | */ |
| 1205 | typedef struct sqlite3_vfs sqlite3_vfs; |
| 1206 | typedef void (SQLITE_SYSAPI *sqlite3_syscall_ptr)(void); |
| 1207 | struct sqlite3_vfs { |
| 1208 | int iVersion; /* Structure version number (currently 3) */ |
| 1209 | int szOsFile; /* Size of subclassed sqlite3_file */ |
| 1210 | int mxPathname; /* Maximum file pathname length */ |
| 1211 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1212 | const char *zName; /* Name of this virtual file system */ |
| 1213 | void *pAppData; /* Pointer to application-specific data */ |
| 1214 | int (SQLITE_CALLBACK *xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, |
| 1215 | int flags, int *pOutFlags); |
| 1216 | int (SQLITE_CALLBACK *xDelete)(sqlite3_vfs*, const char *zName, int syncDir); |
| 1217 | int (SQLITE_CALLBACK *xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); |
| 1218 | int (SQLITE_CALLBACK *xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); |
| 1219 | void *(SQLITE_CALLBACK *xDlOpen)(sqlite3_vfs*, const char *zFilename); |
| 1220 | void (SQLITE_CALLBACK *xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); |
| 1221 | void (SQLITE_CALLBACK *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); |
| 1222 | void (SQLITE_CALLBACK *xDlClose)(sqlite3_vfs*, void*); |
| 1223 | int (SQLITE_CALLBACK *xRandomness)(sqlite3_vfs*, int nByte, char *zOut); |
| 1224 | int (SQLITE_CALLBACK *xSleep)(sqlite3_vfs*, int microseconds); |
| 1225 | int (SQLITE_CALLBACK *xCurrentTime)(sqlite3_vfs*, double*); |
| 1226 | int (SQLITE_CALLBACK *xGetLastError)(sqlite3_vfs*, int, char *); |
| 1227 | /* |
| 1228 | ** The methods above are in version 1 of the sqlite_vfs object |
| 1229 | ** definition. Those that follow are added in version 2 or later |
| 1230 | */ |
| 1231 | int (SQLITE_CALLBACK *xCurrentTimeInt64)(sqlite3_vfs*, sqlite3_int64*); |
| 1232 | /* |
| 1233 | ** The methods above are in versions 1 and 2 of the sqlite_vfs object. |
| 1234 | ** Those below are for version 3 and greater. |
| 1235 | */ |
| 1236 | int (SQLITE_CALLBACK *xSetSystemCall)(sqlite3_vfs*, const char *zName, sqlite3_syscall_ptr); |
| 1237 | sqlite3_syscall_ptr (SQLITE_CALLBACK *xGetSystemCall)(sqlite3_vfs*, const char *zName); |
| 1238 | const char *(SQLITE_CALLBACK *xNextSystemCall)(sqlite3_vfs*, const char *zName); |
| 1239 | /* |
| 1240 | ** The methods above are in versions 1 through 3 of the sqlite_vfs object. |
| 1241 | ** New fields may be appended in future versions. The iVersion |
| 1242 | ** value will increment whenever this happens. |
| 1243 | */ |
| @@ -1369,14 +1378,14 @@ | |
| 1378 | ** sqlite3_os_init() and sqlite3_os_end(). An application-supplied |
| 1379 | ** implementation of sqlite3_os_init() or sqlite3_os_end() |
| 1380 | ** must return [SQLITE_OK] on success and some other [error code] upon |
| 1381 | ** failure. |
| 1382 | */ |
| 1383 | SQLITE_API int SQLITE_APICALL sqlite3_initialize(void); |
| 1384 | SQLITE_API int SQLITE_APICALL sqlite3_shutdown(void); |
| 1385 | SQLITE_API int SQLITE_APICALL sqlite3_os_init(void); |
| 1386 | SQLITE_API int SQLITE_APICALL sqlite3_os_end(void); |
| 1387 | |
| 1388 | /* |
| 1389 | ** CAPI3REF: Configuring The SQLite Library |
| 1390 | ** |
| 1391 | ** The sqlite3_config() interface is used to make global configuration |
| @@ -1491,17 +1500,17 @@ | |
| 1500 | ** SQLite will never invoke xInit() more than once without an intervening |
| 1501 | ** call to xShutdown(). |
| 1502 | */ |
| 1503 | typedef struct sqlite3_mem_methods sqlite3_mem_methods; |
| 1504 | struct sqlite3_mem_methods { |
| 1505 | void *(SQLITE_CALLBACK *xMalloc)(int); /* Memory allocation function */ |
| 1506 | void (SQLITE_CALLBACK *xFree)(void*); /* Free a prior allocation */ |
| 1507 | void *(SQLITE_CALLBACK *xRealloc)(void*,int); /* Resize an allocation */ |
| 1508 | int (SQLITE_CALLBACK *xSize)(void*); /* Return the size of an allocation */ |
| 1509 | int (SQLITE_CALLBACK *xRoundup)(int); /* Round up request size to allocation size */ |
| 1510 | int (SQLITE_CALLBACK *xInit)(void*); /* Initialize the memory allocator */ |
| 1511 | void (SQLITE_CALLBACK *xShutdown)(void*); /* Deinitialize the memory allocator */ |
| 1512 | void *pAppData; /* Argument to xInit() and xShutdown() */ |
| 1513 | }; |
| 1514 | |
| 1515 | /* |
| 1516 | ** CAPI3REF: Configuration Options |
| @@ -1714,11 +1723,11 @@ | |
| 1723 | ** |
| 1724 | ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt> |
| 1725 | ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite |
| 1726 | ** global [error log]. |
| 1727 | ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a |
| 1728 | ** function with a call signature of void(SQLITE_CALLBACK *)(void*,int,const char*), |
| 1729 | ** and a pointer to void. ^If the function pointer is not NULL, it is |
| 1730 | ** invoked by [sqlite3_log()] to process each logging event. ^If the |
| 1731 | ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op. |
| 1732 | ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is |
| 1733 | ** passed through as the first parameter to the application-defined logger |
| @@ -1767,11 +1776,11 @@ | |
| 1776 | ** |
| 1777 | ** [[SQLITE_CONFIG_SQLLOG]] |
| 1778 | ** <dt>SQLITE_CONFIG_SQLLOG |
| 1779 | ** <dd>This option is only available if sqlite is compiled with the |
| 1780 | ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should |
| 1781 | ** be a pointer to a function of type void(SQLITE_CALLBACK *)(void*,sqlite3*,const char*, int). |
| 1782 | ** The second should be of type (void*). The callback is invoked by the library |
| 1783 | ** in three separate circumstances, identified by the value passed as the |
| 1784 | ** fourth parameter. If the fourth parameter is 0, then the database connection |
| 1785 | ** passed as the second argument has just been opened. The third argument |
| 1786 | ** points to a buffer containing the name of the main database file. If the |
| @@ -1965,11 +1974,11 @@ | |
| 1974 | ** |
| 1975 | ** ^The sqlite3_extended_result_codes() routine enables or disables the |
| 1976 | ** [extended result codes] feature of SQLite. ^The extended result |
| 1977 | ** codes are disabled by default for historical compatibility. |
| 1978 | */ |
| 1979 | SQLITE_API int SQLITE_APICALL sqlite3_extended_result_codes(sqlite3*, int onoff); |
| 1980 | |
| 1981 | /* |
| 1982 | ** CAPI3REF: Last Insert Rowid |
| 1983 | ** METHOD: sqlite3 |
| 1984 | ** |
| @@ -2017,11 +2026,11 @@ | |
| 2026 | ** function is running and thus changes the last insert [rowid], |
| 2027 | ** then the value returned by [sqlite3_last_insert_rowid()] is |
| 2028 | ** unpredictable and might not equal either the old or the new |
| 2029 | ** last insert [rowid]. |
| 2030 | */ |
| 2031 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_last_insert_rowid(sqlite3*); |
| 2032 | |
| 2033 | /* |
| 2034 | ** CAPI3REF: Count The Number Of Rows Modified |
| 2035 | ** METHOD: sqlite3 |
| 2036 | ** |
| @@ -2070,11 +2079,11 @@ | |
| 2079 | ** |
| 2080 | ** If a separate thread makes changes on the same database connection |
| 2081 | ** while [sqlite3_changes()] is running then the value returned |
| 2082 | ** is unpredictable and not meaningful. |
| 2083 | */ |
| 2084 | SQLITE_API int SQLITE_APICALL sqlite3_changes(sqlite3*); |
| 2085 | |
| 2086 | /* |
| 2087 | ** CAPI3REF: Total Number Of Rows Modified |
| 2088 | ** METHOD: sqlite3 |
| 2089 | ** |
| @@ -2094,11 +2103,11 @@ | |
| 2103 | ** |
| 2104 | ** If a separate thread makes changes on the same database connection |
| 2105 | ** while [sqlite3_total_changes()] is running then the value |
| 2106 | ** returned is unpredictable and not meaningful. |
| 2107 | */ |
| 2108 | SQLITE_API int SQLITE_APICALL sqlite3_total_changes(sqlite3*); |
| 2109 | |
| 2110 | /* |
| 2111 | ** CAPI3REF: Interrupt A Long-Running Query |
| 2112 | ** METHOD: sqlite3 |
| 2113 | ** |
| @@ -2134,11 +2143,11 @@ | |
| 2143 | ** that are started after the sqlite3_interrupt() call returns. |
| 2144 | ** |
| 2145 | ** If the database connection closes while [sqlite3_interrupt()] |
| 2146 | ** is running then bad things will likely happen. |
| 2147 | */ |
| 2148 | SQLITE_API void SQLITE_APICALL sqlite3_interrupt(sqlite3*); |
| 2149 | |
| 2150 | /* |
| 2151 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| 2152 | ** |
| 2153 | ** These routines are useful during command-line input to determine if the |
| @@ -2169,12 +2178,12 @@ | |
| 2178 | ** UTF-8 string. |
| 2179 | ** |
| 2180 | ** The input to [sqlite3_complete16()] must be a zero-terminated |
| 2181 | ** UTF-16 string in native byte order. |
| 2182 | */ |
| 2183 | SQLITE_API int SQLITE_APICALL sqlite3_complete(const char *sql); |
| 2184 | SQLITE_API int SQLITE_APICALL sqlite3_complete16(const void *sql); |
| 2185 | |
| 2186 | /* |
| 2187 | ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors |
| 2188 | ** KEYWORDS: {busy-handler callback} {busy handler} |
| 2189 | ** METHOD: sqlite3 |
| @@ -2231,11 +2240,11 @@ | |
| 2240 | ** result in undefined behavior. |
| 2241 | ** |
| 2242 | ** A busy handler must not close the database connection |
| 2243 | ** or [prepared statement] that invoked the busy handler. |
| 2244 | */ |
| 2245 | SQLITE_API int SQLITE_APICALL sqlite3_busy_handler(sqlite3*, int(SQLITE_CALLBACK *)(void*,int), void*); |
| 2246 | |
| 2247 | /* |
| 2248 | ** CAPI3REF: Set A Busy Timeout |
| 2249 | ** METHOD: sqlite3 |
| 2250 | ** |
| @@ -2254,11 +2263,11 @@ | |
| 2263 | ** was defined (using [sqlite3_busy_handler()]) prior to calling |
| 2264 | ** this routine, that other busy handler is cleared.)^ |
| 2265 | ** |
| 2266 | ** See also: [PRAGMA busy_timeout] |
| 2267 | */ |
| 2268 | SQLITE_API int SQLITE_APICALL sqlite3_busy_timeout(sqlite3*, int ms); |
| 2269 | |
| 2270 | /* |
| 2271 | ** CAPI3REF: Convenience Routines For Running Queries |
| 2272 | ** METHOD: sqlite3 |
| 2273 | ** |
| @@ -2329,19 +2338,19 @@ | |
| 2338 | ** interface defined here. As a consequence, errors that occur in the |
| 2339 | ** wrapper layer outside of the internal [sqlite3_exec()] call are not |
| 2340 | ** reflected in subsequent calls to [sqlite3_errcode()] or |
| 2341 | ** [sqlite3_errmsg()]. |
| 2342 | */ |
| 2343 | SQLITE_API int SQLITE_APICALL sqlite3_get_table( |
| 2344 | sqlite3 *db, /* An open database */ |
| 2345 | const char *zSql, /* SQL to be evaluated */ |
| 2346 | char ***pazResult, /* Results of the query */ |
| 2347 | int *pnRow, /* Number of result rows written here */ |
| 2348 | int *pnColumn, /* Number of result columns written here */ |
| 2349 | char **pzErrmsg /* Error msg written here */ |
| 2350 | ); |
| 2351 | SQLITE_API void SQLITE_APICALL sqlite3_free_table(char **result); |
| 2352 | |
| 2353 | /* |
| 2354 | ** CAPI3REF: Formatted String Printing Functions |
| 2355 | ** |
| 2356 | ** These routines are work-alikes of the "printf()" family of functions |
| @@ -2444,13 +2453,13 @@ | |
| 2453 | ** ^(The "%z" formatting option works like "%s" but with the |
| 2454 | ** addition that after the string has been read and copied into |
| 2455 | ** the result, [sqlite3_free()] is called on the input string.)^ |
| 2456 | */ |
| 2457 | SQLITE_API char *SQLITE_CDECL sqlite3_mprintf(const char*,...); |
| 2458 | SQLITE_API char *SQLITE_APICALL sqlite3_vmprintf(const char*, va_list); |
| 2459 | SQLITE_API char *SQLITE_CDECL sqlite3_snprintf(int,char*,const char*, ...); |
| 2460 | SQLITE_API char *SQLITE_APICALL sqlite3_vsnprintf(int,char*,const char*, va_list); |
| 2461 | |
| 2462 | /* |
| 2463 | ** CAPI3REF: Memory Allocation Subsystem |
| 2464 | ** |
| 2465 | ** The SQLite core uses these three routines for all of its own |
| @@ -2536,16 +2545,16 @@ | |
| 2545 | ** |
| 2546 | ** The application must not read or write any part of |
| 2547 | ** a block of memory after it has been released using |
| 2548 | ** [sqlite3_free()] or [sqlite3_realloc()]. |
| 2549 | */ |
| 2550 | SQLITE_API void *SQLITE_APICALL sqlite3_malloc(int); |
| 2551 | SQLITE_API void *SQLITE_APICALL sqlite3_malloc64(sqlite3_uint64); |
| 2552 | SQLITE_API void *SQLITE_APICALL sqlite3_realloc(void*, int); |
| 2553 | SQLITE_API void *SQLITE_APICALL sqlite3_realloc64(void*, sqlite3_uint64); |
| 2554 | SQLITE_API void SQLITE_APICALL sqlite3_free(void*); |
| 2555 | SQLITE_API sqlite3_uint64 SQLITE_APICALL sqlite3_msize(void*); |
| 2556 | |
| 2557 | /* |
| 2558 | ** CAPI3REF: Memory Allocator Statistics |
| 2559 | ** |
| 2560 | ** SQLite provides these two interfaces for reporting on the status |
| @@ -2566,12 +2575,12 @@ | |
| 2575 | ** [sqlite3_memory_used()] if and only if the parameter to |
| 2576 | ** [sqlite3_memory_highwater()] is true. ^The value returned |
| 2577 | ** by [sqlite3_memory_highwater(1)] is the high-water mark |
| 2578 | ** prior to the reset. |
| 2579 | */ |
| 2580 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_used(void); |
| 2581 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_memory_highwater(int resetFlag); |
| 2582 | |
| 2583 | /* |
| 2584 | ** CAPI3REF: Pseudo-Random Number Generator |
| 2585 | ** |
| 2586 | ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to |
| @@ -2590,11 +2599,11 @@ | |
| 2599 | ** ^If the previous call to this routine had an N of 1 or more and a |
| 2600 | ** non-NULL P then the pseudo-randomness is generated |
| 2601 | ** internally and without recourse to the [sqlite3_vfs] xRandomness |
| 2602 | ** method. |
| 2603 | */ |
| 2604 | SQLITE_API void SQLITE_APICALL sqlite3_randomness(int N, void *P); |
| 2605 | |
| 2606 | /* |
| 2607 | ** CAPI3REF: Compile-Time Authorization Callbacks |
| 2608 | ** METHOD: sqlite3 |
| 2609 | ** |
| @@ -2673,13 +2682,13 @@ | |
| 2682 | ** [sqlite3_prepare()] or its variants. Authorization is not |
| 2683 | ** performed during statement evaluation in [sqlite3_step()], unless |
| 2684 | ** as stated in the previous paragraph, sqlite3_step() invokes |
| 2685 | ** sqlite3_prepare_v2() to reprepare a statement after a schema change. |
| 2686 | */ |
| 2687 | SQLITE_API int SQLITE_APICALL sqlite3_set_authorizer( |
| 2688 | sqlite3*, |
| 2689 | int (SQLITE_CALLBACK *xAuth)(void*,int,const char*,const char*,const char*,const char*), |
| 2690 | void *pUserData |
| 2691 | ); |
| 2692 | |
| 2693 | /* |
| 2694 | ** CAPI3REF: Authorizer Return Codes |
| @@ -2781,14 +2790,14 @@ | |
| 2790 | ** digits in the time are meaningless. Future versions of SQLite |
| 2791 | ** might provide greater resolution on the profiler callback. The |
| 2792 | ** sqlite3_profile() function is considered experimental and is |
| 2793 | ** subject to change in future versions of SQLite. |
| 2794 | */ |
| 2795 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_trace(sqlite3*, |
| 2796 | void(SQLITE_CALLBACK *xTrace)(void*,const char*), void*); |
| 2797 | SQLITE_API SQLITE_DEPRECATED void *SQLITE_APICALL sqlite3_profile(sqlite3*, |
| 2798 | void(SQLITE_CALLBACK *xProfile)(void*,const char*,sqlite3_uint64), void*); |
| 2799 | |
| 2800 | /* |
| 2801 | ** CAPI3REF: SQL Trace Event Codes |
| 2802 | ** KEYWORDS: SQLITE_TRACE |
| 2803 | ** |
| @@ -2872,14 +2881,14 @@ | |
| 2881 | ** |
| 2882 | ** The sqlite3_trace_v2() interface is intended to replace the legacy |
| 2883 | ** interfaces [sqlite3_trace()] and [sqlite3_profile()], both of which |
| 2884 | ** are deprecated. |
| 2885 | */ |
| 2886 | SQLITE_API int SQLITE_APICALL sqlite3_trace_v2( |
| 2887 | sqlite3*, |
| 2888 | unsigned uMask, |
| 2889 | int(SQLITE_CALLBACK *xCallback)(unsigned,void*,void*,void*), |
| 2890 | void *pCtx |
| 2891 | ); |
| 2892 | |
| 2893 | /* |
| 2894 | ** CAPI3REF: Query Progress Callbacks |
| @@ -2911,11 +2920,11 @@ | |
| 2920 | ** the database connection that invoked the progress handler. |
| 2921 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 2922 | ** database connections for the meaning of "modify" in this paragraph. |
| 2923 | ** |
| 2924 | */ |
| 2925 | SQLITE_API void SQLITE_APICALL sqlite3_progress_handler(sqlite3*, int, int(SQLITE_CALLBACK *)(void*), void*); |
| 2926 | |
| 2927 | /* |
| 2928 | ** CAPI3REF: Opening A New Database Connection |
| 2929 | ** CONSTRUCTOR: sqlite3 |
| 2930 | ** |
| @@ -3140,19 +3149,19 @@ | |
| 3149 | ** prior to calling sqlite3_open() or sqlite3_open_v2(). Otherwise, various |
| 3150 | ** features that require the use of temporary files may fail. |
| 3151 | ** |
| 3152 | ** See also: [sqlite3_temp_directory] |
| 3153 | */ |
| 3154 | SQLITE_API int SQLITE_APICALL sqlite3_open( |
| 3155 | const char *filename, /* Database filename (UTF-8) */ |
| 3156 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3157 | ); |
| 3158 | SQLITE_API int SQLITE_APICALL sqlite3_open16( |
| 3159 | const void *filename, /* Database filename (UTF-16) */ |
| 3160 | sqlite3 **ppDb /* OUT: SQLite db handle */ |
| 3161 | ); |
| 3162 | SQLITE_API int SQLITE_APICALL sqlite3_open_v2( |
| 3163 | const char *filename, /* Database filename (UTF-8) */ |
| 3164 | sqlite3 **ppDb, /* OUT: SQLite db handle */ |
| 3165 | int flags, /* Flags */ |
| 3166 | const char *zVfs /* Name of VFS module to use */ |
| 3167 | ); |
| @@ -3194,13 +3203,13 @@ | |
| 3203 | ** sqlite3_uri_boolean(F,P,B) returns B. If F is not a NULL pointer and |
| 3204 | ** is not a database file pathname pointer that SQLite passed into the xOpen |
| 3205 | ** VFS method, then the behavior of this routine is undefined and probably |
| 3206 | ** undesirable. |
| 3207 | */ |
| 3208 | SQLITE_API const char *SQLITE_APICALL sqlite3_uri_parameter(const char *zFilename, const char *zParam); |
| 3209 | SQLITE_API int SQLITE_APICALL sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); |
| 3210 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_uri_int64(const char*, const char*, sqlite3_int64); |
| 3211 | |
| 3212 | |
| 3213 | /* |
| 3214 | ** CAPI3REF: Error Codes And Messages |
| 3215 | ** METHOD: sqlite3 |
| @@ -3240,15 +3249,15 @@ | |
| 3249 | ** |
| 3250 | ** If an interface fails with SQLITE_MISUSE, that means the interface |
| 3251 | ** was invoked incorrectly by the application. In that case, the |
| 3252 | ** error code and message may or may not be set. |
| 3253 | */ |
| 3254 | SQLITE_API int SQLITE_APICALL sqlite3_errcode(sqlite3 *db); |
| 3255 | SQLITE_API int SQLITE_APICALL sqlite3_extended_errcode(sqlite3 *db); |
| 3256 | SQLITE_API const char *SQLITE_APICALL sqlite3_errmsg(sqlite3*); |
| 3257 | SQLITE_API const void *SQLITE_APICALL sqlite3_errmsg16(sqlite3*); |
| 3258 | SQLITE_API const char *SQLITE_APICALL sqlite3_errstr(int); |
| 3259 | |
| 3260 | /* |
| 3261 | ** CAPI3REF: Prepared Statement Object |
| 3262 | ** KEYWORDS: {prepared statement} {prepared statements} |
| 3263 | ** |
| @@ -3312,11 +3321,11 @@ | |
| 3321 | ** created by an untrusted script can be contained using the |
| 3322 | ** [max_page_count] [PRAGMA]. |
| 3323 | ** |
| 3324 | ** New run-time limit categories may be added in future releases. |
| 3325 | */ |
| 3326 | SQLITE_API int SQLITE_APICALL sqlite3_limit(sqlite3*, int id, int newVal); |
| 3327 | |
| 3328 | /* |
| 3329 | ** CAPI3REF: Run-Time Limit Categories |
| 3330 | ** KEYWORDS: {limit category} {*limit categories} |
| 3331 | ** |
| @@ -3464,32 +3473,32 @@ | |
| 3473 | ** or [GLOB] operator or if the parameter is compared to an indexed column |
| 3474 | ** and the [SQLITE_ENABLE_STAT3] compile-time option is enabled. |
| 3475 | ** </li> |
| 3476 | ** </ol> |
| 3477 | */ |
| 3478 | SQLITE_API int SQLITE_APICALL sqlite3_prepare( |
| 3479 | sqlite3 *db, /* Database handle */ |
| 3480 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3481 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3482 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3483 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3484 | ); |
| 3485 | SQLITE_API int SQLITE_APICALL sqlite3_prepare_v2( |
| 3486 | sqlite3 *db, /* Database handle */ |
| 3487 | const char *zSql, /* SQL statement, UTF-8 encoded */ |
| 3488 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3489 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3490 | const char **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3491 | ); |
| 3492 | SQLITE_API int SQLITE_APICALL sqlite3_prepare16( |
| 3493 | sqlite3 *db, /* Database handle */ |
| 3494 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3495 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3496 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3497 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| 3498 | ); |
| 3499 | SQLITE_API int SQLITE_APICALL sqlite3_prepare16_v2( |
| 3500 | sqlite3 *db, /* Database handle */ |
| 3501 | const void *zSql, /* SQL statement, UTF-16 encoded */ |
| 3502 | int nByte, /* Maximum length of zSql in bytes. */ |
| 3503 | sqlite3_stmt **ppStmt, /* OUT: Statement handle */ |
| 3504 | const void **pzTail /* OUT: Pointer to unused portion of zSql */ |
| @@ -3524,12 +3533,12 @@ | |
| 3533 | ** automatically freed when the prepared statement is finalized. |
| 3534 | ** ^The string returned by sqlite3_expanded_sql(P), on the other hand, |
| 3535 | ** is obtained from [sqlite3_malloc()] and must be free by the application |
| 3536 | ** by passing it to [sqlite3_free()]. |
| 3537 | */ |
| 3538 | SQLITE_API const char *SQLITE_APICALL sqlite3_sql(sqlite3_stmt *pStmt); |
| 3539 | SQLITE_API char *SQLITE_APICALL sqlite3_expanded_sql(sqlite3_stmt *pStmt); |
| 3540 | |
| 3541 | /* |
| 3542 | ** CAPI3REF: Determine If An SQL Statement Writes The Database |
| 3543 | ** METHOD: sqlite3_stmt |
| 3544 | ** |
| @@ -3557,11 +3566,11 @@ | |
| 3566 | ** database. ^The [ATTACH] and [DETACH] statements also cause |
| 3567 | ** sqlite3_stmt_readonly() to return true since, while those statements |
| 3568 | ** change the configuration of a database connection, they do not make |
| 3569 | ** changes to the content of the database files on disk. |
| 3570 | */ |
| 3571 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 3572 | |
| 3573 | /* |
| 3574 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 3575 | ** METHOD: sqlite3_stmt |
| 3576 | ** |
| @@ -3578,11 +3587,11 @@ | |
| 3587 | ** to locate all prepared statements associated with a database |
| 3588 | ** connection that are in need of being reset. This can be used, |
| 3589 | ** for example, in diagnostic routines to search for prepared |
| 3590 | ** statements that are holding a transaction open. |
| 3591 | */ |
| 3592 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_busy(sqlite3_stmt*); |
| 3593 | |
| 3594 | /* |
| 3595 | ** CAPI3REF: Dynamically Typed Value Object |
| 3596 | ** KEYWORDS: {protected sqlite3_value} {unprotected sqlite3_value} |
| 3597 | ** |
| @@ -3742,24 +3751,24 @@ | |
| 3751 | ** index is out of range. ^[SQLITE_NOMEM] is returned if malloc() fails. |
| 3752 | ** |
| 3753 | ** See also: [sqlite3_bind_parameter_count()], |
| 3754 | ** [sqlite3_bind_parameter_name()], and [sqlite3_bind_parameter_index()]. |
| 3755 | */ |
| 3756 | SQLITE_API int SQLITE_APICALL sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(SQLITE_CALLBACK *)(void*)); |
| 3757 | SQLITE_API int SQLITE_APICALL sqlite3_bind_blob64(sqlite3_stmt*, int, const void*, sqlite3_uint64, |
| 3758 | void(SQLITE_CALLBACK *)(void*)); |
| 3759 | SQLITE_API int SQLITE_APICALL sqlite3_bind_double(sqlite3_stmt*, int, double); |
| 3760 | SQLITE_API int SQLITE_APICALL sqlite3_bind_int(sqlite3_stmt*, int, int); |
| 3761 | SQLITE_API int SQLITE_APICALL sqlite3_bind_int64(sqlite3_stmt*, int, sqlite3_int64); |
| 3762 | SQLITE_API int SQLITE_APICALL sqlite3_bind_null(sqlite3_stmt*, int); |
| 3763 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text(sqlite3_stmt*,int,const char*,int,void(SQLITE_CALLBACK *)(void*)); |
| 3764 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text16(sqlite3_stmt*, int, const void*, int, void(SQLITE_CALLBACK *)(void*)); |
| 3765 | SQLITE_API int SQLITE_APICALL sqlite3_bind_text64(sqlite3_stmt*, int, const char*, sqlite3_uint64, |
| 3766 | void(SQLITE_CALLBACK *)(void*), unsigned char encoding); |
| 3767 | SQLITE_API int SQLITE_APICALL sqlite3_bind_value(sqlite3_stmt*, int, const sqlite3_value*); |
| 3768 | SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob(sqlite3_stmt*, int, int n); |
| 3769 | SQLITE_API int SQLITE_APICALL sqlite3_bind_zeroblob64(sqlite3_stmt*, int, sqlite3_uint64); |
| 3770 | |
| 3771 | /* |
| 3772 | ** CAPI3REF: Number Of SQL Parameters |
| 3773 | ** METHOD: sqlite3_stmt |
| 3774 | ** |
| @@ -3776,11 +3785,11 @@ | |
| 3785 | ** |
| 3786 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3787 | ** [sqlite3_bind_parameter_name()], and |
| 3788 | ** [sqlite3_bind_parameter_index()]. |
| 3789 | */ |
| 3790 | SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_count(sqlite3_stmt*); |
| 3791 | |
| 3792 | /* |
| 3793 | ** CAPI3REF: Name Of A Host Parameter |
| 3794 | ** METHOD: sqlite3_stmt |
| 3795 | ** |
| @@ -3804,11 +3813,11 @@ | |
| 3813 | ** |
| 3814 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3815 | ** [sqlite3_bind_parameter_count()], and |
| 3816 | ** [sqlite3_bind_parameter_index()]. |
| 3817 | */ |
| 3818 | SQLITE_API const char *SQLITE_APICALL sqlite3_bind_parameter_name(sqlite3_stmt*, int); |
| 3819 | |
| 3820 | /* |
| 3821 | ** CAPI3REF: Index Of A Parameter With A Given Name |
| 3822 | ** METHOD: sqlite3_stmt |
| 3823 | ** |
| @@ -3821,21 +3830,21 @@ | |
| 3830 | ** |
| 3831 | ** See also: [sqlite3_bind_blob|sqlite3_bind()], |
| 3832 | ** [sqlite3_bind_parameter_count()], and |
| 3833 | ** [sqlite3_bind_parameter_name()]. |
| 3834 | */ |
| 3835 | SQLITE_API int SQLITE_APICALL sqlite3_bind_parameter_index(sqlite3_stmt*, const char *zName); |
| 3836 | |
| 3837 | /* |
| 3838 | ** CAPI3REF: Reset All Bindings On A Prepared Statement |
| 3839 | ** METHOD: sqlite3_stmt |
| 3840 | ** |
| 3841 | ** ^Contrary to the intuition of many, [sqlite3_reset()] does not reset |
| 3842 | ** the [sqlite3_bind_blob | bindings] on a [prepared statement]. |
| 3843 | ** ^Use this routine to reset all host parameters to NULL. |
| 3844 | */ |
| 3845 | SQLITE_API int SQLITE_APICALL sqlite3_clear_bindings(sqlite3_stmt*); |
| 3846 | |
| 3847 | /* |
| 3848 | ** CAPI3REF: Number Of Columns In A Result Set |
| 3849 | ** METHOD: sqlite3_stmt |
| 3850 | ** |
| @@ -3843,11 +3852,11 @@ | |
| 3852 | ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL |
| 3853 | ** statement that does not return data (for example an [UPDATE]). |
| 3854 | ** |
| 3855 | ** See also: [sqlite3_data_count()] |
| 3856 | */ |
| 3857 | SQLITE_API int SQLITE_APICALL sqlite3_column_count(sqlite3_stmt *pStmt); |
| 3858 | |
| 3859 | /* |
| 3860 | ** CAPI3REF: Column Names In A Result Set |
| 3861 | ** METHOD: sqlite3_stmt |
| 3862 | ** |
| @@ -3872,12 +3881,12 @@ | |
| 3881 | ** ^The name of a result column is the value of the "AS" clause for |
| 3882 | ** that column, if there is an AS clause. If there is no AS clause |
| 3883 | ** then the name of the column is unspecified and may change from |
| 3884 | ** one release of SQLite to the next. |
| 3885 | */ |
| 3886 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_name(sqlite3_stmt*, int N); |
| 3887 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_name16(sqlite3_stmt*, int N); |
| 3888 | |
| 3889 | /* |
| 3890 | ** CAPI3REF: Source Of Data In A Query Result |
| 3891 | ** METHOD: sqlite3_stmt |
| 3892 | ** |
| @@ -3921,16 +3930,16 @@ | |
| 3930 | ** If two or more threads call one or more |
| 3931 | ** [sqlite3_column_database_name | column metadata interfaces] |
| 3932 | ** for the same [prepared statement] and result column |
| 3933 | ** at the same time then the results are undefined. |
| 3934 | */ |
| 3935 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_database_name(sqlite3_stmt*,int); |
| 3936 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_database_name16(sqlite3_stmt*,int); |
| 3937 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_table_name(sqlite3_stmt*,int); |
| 3938 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_table_name16(sqlite3_stmt*,int); |
| 3939 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_origin_name(sqlite3_stmt*,int); |
| 3940 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_origin_name16(sqlite3_stmt*,int); |
| 3941 | |
| 3942 | /* |
| 3943 | ** CAPI3REF: Declared Datatype Of A Query Result |
| 3944 | ** METHOD: sqlite3_stmt |
| 3945 | ** |
| @@ -3958,12 +3967,12 @@ | |
| 3967 | ** data stored in that column is of the declared type. SQLite is |
| 3968 | ** strongly typed, but the typing is dynamic not static. ^Type |
| 3969 | ** is associated with individual values, not with the containers |
| 3970 | ** used to hold those values. |
| 3971 | */ |
| 3972 | SQLITE_API const char *SQLITE_APICALL sqlite3_column_decltype(sqlite3_stmt*,int); |
| 3973 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_decltype16(sqlite3_stmt*,int); |
| 3974 | |
| 3975 | /* |
| 3976 | ** CAPI3REF: Evaluate An SQL Statement |
| 3977 | ** METHOD: sqlite3_stmt |
| 3978 | ** |
| @@ -4039,11 +4048,11 @@ | |
| 4048 | ** using either [sqlite3_prepare_v2()] or [sqlite3_prepare16_v2()] instead |
| 4049 | ** of the legacy [sqlite3_prepare()] and [sqlite3_prepare16()] interfaces, |
| 4050 | ** then the more specific [error codes] are returned directly |
| 4051 | ** by sqlite3_step(). The use of the "v2" interface is recommended. |
| 4052 | */ |
| 4053 | SQLITE_API int SQLITE_APICALL sqlite3_step(sqlite3_stmt*); |
| 4054 | |
| 4055 | /* |
| 4056 | ** CAPI3REF: Number of columns in a result set |
| 4057 | ** METHOD: sqlite3_stmt |
| 4058 | ** |
| @@ -4060,11 +4069,11 @@ | |
| 4069 | ** where it always returns zero since each step of that multi-step |
| 4070 | ** pragma returns 0 columns of data. |
| 4071 | ** |
| 4072 | ** See also: [sqlite3_column_count()] |
| 4073 | */ |
| 4074 | SQLITE_API int SQLITE_APICALL sqlite3_data_count(sqlite3_stmt *pStmt); |
| 4075 | |
| 4076 | /* |
| 4077 | ** CAPI3REF: Fundamental Datatypes |
| 4078 | ** KEYWORDS: SQLITE_TEXT |
| 4079 | ** |
| @@ -4250,20 +4259,20 @@ | |
| 4259 | ** of these routines, a default value is returned. The default value |
| 4260 | ** is either the integer 0, the floating point number 0.0, or a NULL |
| 4261 | ** pointer. Subsequent calls to [sqlite3_errcode()] will return |
| 4262 | ** [SQLITE_NOMEM].)^ |
| 4263 | */ |
| 4264 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_blob(sqlite3_stmt*, int iCol); |
| 4265 | SQLITE_API int SQLITE_APICALL sqlite3_column_bytes(sqlite3_stmt*, int iCol); |
| 4266 | SQLITE_API int SQLITE_APICALL sqlite3_column_bytes16(sqlite3_stmt*, int iCol); |
| 4267 | SQLITE_API double SQLITE_APICALL sqlite3_column_double(sqlite3_stmt*, int iCol); |
| 4268 | SQLITE_API int SQLITE_APICALL sqlite3_column_int(sqlite3_stmt*, int iCol); |
| 4269 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_column_int64(sqlite3_stmt*, int iCol); |
| 4270 | SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_column_text(sqlite3_stmt*, int iCol); |
| 4271 | SQLITE_API const void *SQLITE_APICALL sqlite3_column_text16(sqlite3_stmt*, int iCol); |
| 4272 | SQLITE_API int SQLITE_APICALL sqlite3_column_type(sqlite3_stmt*, int iCol); |
| 4273 | SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_column_value(sqlite3_stmt*, int iCol); |
| 4274 | |
| 4275 | /* |
| 4276 | ** CAPI3REF: Destroy A Prepared Statement Object |
| 4277 | ** DESTRUCTOR: sqlite3_stmt |
| 4278 | ** |
| @@ -4287,11 +4296,11 @@ | |
| 4296 | ** resource leaks. It is a grievous error for the application to try to use |
| 4297 | ** a prepared statement after it has been finalized. Any use of a prepared |
| 4298 | ** statement after it has been finalized can result in undefined and |
| 4299 | ** undesirable behavior such as segfaults and heap corruption. |
| 4300 | */ |
| 4301 | SQLITE_API int SQLITE_APICALL sqlite3_finalize(sqlite3_stmt *pStmt); |
| 4302 | |
| 4303 | /* |
| 4304 | ** CAPI3REF: Reset A Prepared Statement Object |
| 4305 | ** METHOD: sqlite3_stmt |
| 4306 | ** |
| @@ -4314,11 +4323,11 @@ | |
| 4323 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 4324 | ** |
| 4325 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 4326 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| 4327 | */ |
| 4328 | SQLITE_API int SQLITE_APICALL sqlite3_reset(sqlite3_stmt *pStmt); |
| 4329 | |
| 4330 | /* |
| 4331 | ** CAPI3REF: Create Or Redefine SQL Functions |
| 4332 | ** KEYWORDS: {function creation routines} |
| 4333 | ** KEYWORDS: {application-defined SQL function} |
| @@ -4414,40 +4423,40 @@ | |
| 4423 | ** ^An application-defined function is permitted to call other |
| 4424 | ** SQLite interfaces. However, such calls must not |
| 4425 | ** close the database connection nor finalize or reset the prepared |
| 4426 | ** statement in which the function is running. |
| 4427 | */ |
| 4428 | SQLITE_API int SQLITE_APICALL sqlite3_create_function( |
| 4429 | sqlite3 *db, |
| 4430 | const char *zFunctionName, |
| 4431 | int nArg, |
| 4432 | int eTextRep, |
| 4433 | void *pApp, |
| 4434 | void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4435 | void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4436 | void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) |
| 4437 | ); |
| 4438 | SQLITE_API int SQLITE_APICALL sqlite3_create_function16( |
| 4439 | sqlite3 *db, |
| 4440 | const void *zFunctionName, |
| 4441 | int nArg, |
| 4442 | int eTextRep, |
| 4443 | void *pApp, |
| 4444 | void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4445 | void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4446 | void (SQLITE_CALLBACK *xFinal)(sqlite3_context*) |
| 4447 | ); |
| 4448 | SQLITE_API int SQLITE_APICALL sqlite3_create_function_v2( |
| 4449 | sqlite3 *db, |
| 4450 | const char *zFunctionName, |
| 4451 | int nArg, |
| 4452 | int eTextRep, |
| 4453 | void *pApp, |
| 4454 | void (SQLITE_CALLBACK *xFunc)(sqlite3_context*,int,sqlite3_value**), |
| 4455 | void (SQLITE_CALLBACK *xStep)(sqlite3_context*,int,sqlite3_value**), |
| 4456 | void (SQLITE_CALLBACK *xFinal)(sqlite3_context*), |
| 4457 | void(SQLITE_CALLBACK *xDestroy)(void*) |
| 4458 | ); |
| 4459 | |
| 4460 | /* |
| 4461 | ** CAPI3REF: Text Encodings |
| 4462 | ** |
| @@ -4480,16 +4489,16 @@ | |
| 4489 | ** to be supported. However, new applications should avoid |
| 4490 | ** the use of these functions. To encourage programmers to avoid |
| 4491 | ** these functions, we will not explain what they do. |
| 4492 | */ |
| 4493 | #ifndef SQLITE_OMIT_DEPRECATED |
| 4494 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_aggregate_count(sqlite3_context*); |
| 4495 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_expired(sqlite3_stmt*); |
| 4496 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); |
| 4497 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_global_recover(void); |
| 4498 | SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_thread_cleanup(void); |
| 4499 | SQLITE_API SQLITE_DEPRECATED int SQLITE_APICALL sqlite3_memory_alarm(void(SQLITE_CALLBACK *)(void*,sqlite3_int64,int), |
| 4500 | void*,sqlite3_int64); |
| 4501 | #endif |
| 4502 | |
| 4503 | /* |
| 4504 | ** CAPI3REF: Obtaining SQL Values |
| @@ -4535,22 +4544,22 @@ | |
| 4544 | ** or [sqlite3_value_text16()]. |
| 4545 | ** |
| 4546 | ** These routines must be called from the same thread as |
| 4547 | ** the SQL function that supplied the [sqlite3_value*] parameters. |
| 4548 | */ |
| 4549 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_blob(sqlite3_value*); |
| 4550 | SQLITE_API int SQLITE_APICALL sqlite3_value_bytes(sqlite3_value*); |
| 4551 | SQLITE_API int SQLITE_APICALL sqlite3_value_bytes16(sqlite3_value*); |
| 4552 | SQLITE_API double SQLITE_APICALL sqlite3_value_double(sqlite3_value*); |
| 4553 | SQLITE_API int SQLITE_APICALL sqlite3_value_int(sqlite3_value*); |
| 4554 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_value_int64(sqlite3_value*); |
| 4555 | SQLITE_API const unsigned char *SQLITE_APICALL sqlite3_value_text(sqlite3_value*); |
| 4556 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16(sqlite3_value*); |
| 4557 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16le(sqlite3_value*); |
| 4558 | SQLITE_API const void *SQLITE_APICALL sqlite3_value_text16be(sqlite3_value*); |
| 4559 | SQLITE_API int SQLITE_APICALL sqlite3_value_type(sqlite3_value*); |
| 4560 | SQLITE_API int SQLITE_APICALL sqlite3_value_numeric_type(sqlite3_value*); |
| 4561 | |
| 4562 | /* |
| 4563 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 4564 | ** METHOD: sqlite3_value |
| 4565 | ** |
| @@ -4562,11 +4571,11 @@ | |
| 4571 | ** |
| 4572 | ** SQLite makes no use of subtype itself. It merely passes the subtype |
| 4573 | ** from the result of one [application-defined SQL function] into the |
| 4574 | ** input of another. |
| 4575 | */ |
| 4576 | SQLITE_API unsigned int SQLITE_APICALL sqlite3_value_subtype(sqlite3_value*); |
| 4577 | |
| 4578 | /* |
| 4579 | ** CAPI3REF: Copy And Free SQL Values |
| 4580 | ** METHOD: sqlite3_value |
| 4581 | ** |
| @@ -4578,12 +4587,12 @@ | |
| 4587 | ** |
| 4588 | ** ^The sqlite3_value_free(V) interface frees an [sqlite3_value] object |
| 4589 | ** previously obtained from [sqlite3_value_dup()]. ^If V is a NULL pointer |
| 4590 | ** then sqlite3_value_free(V) is a harmless no-op. |
| 4591 | */ |
| 4592 | SQLITE_API sqlite3_value *SQLITE_APICALL sqlite3_value_dup(const sqlite3_value*); |
| 4593 | SQLITE_API void SQLITE_APICALL sqlite3_value_free(sqlite3_value*); |
| 4594 | |
| 4595 | /* |
| 4596 | ** CAPI3REF: Obtain Aggregate Function Context |
| 4597 | ** METHOD: sqlite3_context |
| 4598 | ** |
| @@ -4624,11 +4633,11 @@ | |
| 4633 | ** function. |
| 4634 | ** |
| 4635 | ** This routine must be called from the same thread in which |
| 4636 | ** the aggregate SQL function is running. |
| 4637 | */ |
| 4638 | SQLITE_API void *SQLITE_APICALL sqlite3_aggregate_context(sqlite3_context*, int nBytes); |
| 4639 | |
| 4640 | /* |
| 4641 | ** CAPI3REF: User Data For Functions |
| 4642 | ** METHOD: sqlite3_context |
| 4643 | ** |
| @@ -4639,11 +4648,11 @@ | |
| 4648 | ** registered the application defined function. |
| 4649 | ** |
| 4650 | ** This routine must be called from the same thread in which |
| 4651 | ** the application-defined function is running. |
| 4652 | */ |
| 4653 | SQLITE_API void *SQLITE_APICALL sqlite3_user_data(sqlite3_context*); |
| 4654 | |
| 4655 | /* |
| 4656 | ** CAPI3REF: Database Connection For Functions |
| 4657 | ** METHOD: sqlite3_context |
| 4658 | ** |
| @@ -4651,11 +4660,11 @@ | |
| 4660 | ** the pointer to the [database connection] (the 1st parameter) |
| 4661 | ** of the [sqlite3_create_function()] |
| 4662 | ** and [sqlite3_create_function16()] routines that originally |
| 4663 | ** registered the application defined function. |
| 4664 | */ |
| 4665 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_context_db_handle(sqlite3_context*); |
| 4666 | |
| 4667 | /* |
| 4668 | ** CAPI3REF: Function Auxiliary Data |
| 4669 | ** METHOD: sqlite3_context |
| 4670 | ** |
| @@ -4704,12 +4713,12 @@ | |
| 4713 | ** values and [parameters] and expressions composed from the same.)^ |
| 4714 | ** |
| 4715 | ** These routines must be called from the same thread in which |
| 4716 | ** the SQL function is running. |
| 4717 | */ |
| 4718 | SQLITE_API void *SQLITE_APICALL sqlite3_get_auxdata(sqlite3_context*, int N); |
| 4719 | SQLITE_API void SQLITE_APICALL sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (SQLITE_CALLBACK *)(void*)); |
| 4720 | |
| 4721 | |
| 4722 | /* |
| 4723 | ** CAPI3REF: Constants Defining Special Destructor Behavior |
| 4724 | ** |
| @@ -4722,11 +4731,11 @@ | |
| 4731 | ** the content before returning. |
| 4732 | ** |
| 4733 | ** The typedef is necessary to work around problems in certain |
| 4734 | ** C++ compilers. |
| 4735 | */ |
| 4736 | typedef void (SQLITE_CALLBACK *sqlite3_destructor_type)(void*); |
| 4737 | #define SQLITE_STATIC ((sqlite3_destructor_type)0) |
| 4738 | #define SQLITE_TRANSIENT ((sqlite3_destructor_type)-1) |
| 4739 | |
| 4740 | /* |
| 4741 | ** CAPI3REF: Setting The Result Of An SQL Function |
| @@ -4841,31 +4850,31 @@ | |
| 4850 | ** |
| 4851 | ** If these routines are called from within the different thread |
| 4852 | ** than the one containing the application-defined function that received |
| 4853 | ** the [sqlite3_context] pointer, the results are undefined. |
| 4854 | */ |
| 4855 | SQLITE_API void SQLITE_APICALL sqlite3_result_blob(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); |
| 4856 | SQLITE_API void SQLITE_APICALL sqlite3_result_blob64(sqlite3_context*,const void*, |
| 4857 | sqlite3_uint64,void(SQLITE_CALLBACK *)(void*)); |
| 4858 | SQLITE_API void SQLITE_APICALL sqlite3_result_double(sqlite3_context*, double); |
| 4859 | SQLITE_API void SQLITE_APICALL sqlite3_result_error(sqlite3_context*, const char*, int); |
| 4860 | SQLITE_API void SQLITE_APICALL sqlite3_result_error16(sqlite3_context*, const void*, int); |
| 4861 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_toobig(sqlite3_context*); |
| 4862 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_nomem(sqlite3_context*); |
| 4863 | SQLITE_API void SQLITE_APICALL sqlite3_result_error_code(sqlite3_context*, int); |
| 4864 | SQLITE_API void SQLITE_APICALL sqlite3_result_int(sqlite3_context*, int); |
| 4865 | SQLITE_API void SQLITE_APICALL sqlite3_result_int64(sqlite3_context*, sqlite3_int64); |
| 4866 | SQLITE_API void SQLITE_APICALL sqlite3_result_null(sqlite3_context*); |
| 4867 | SQLITE_API void SQLITE_APICALL sqlite3_result_text(sqlite3_context*, const char*, int, void(SQLITE_CALLBACK *)(void*)); |
| 4868 | SQLITE_API void SQLITE_APICALL sqlite3_result_text64(sqlite3_context*, const char*,sqlite3_uint64, |
| 4869 | void(SQLITE_CALLBACK *)(void*), unsigned char encoding); |
| 4870 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16(sqlite3_context*, const void*, int, void(SQLITE_CALLBACK *)(void*)); |
| 4871 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16le(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); |
| 4872 | SQLITE_API void SQLITE_APICALL sqlite3_result_text16be(sqlite3_context*, const void*, int,void(SQLITE_CALLBACK *)(void*)); |
| 4873 | SQLITE_API void SQLITE_APICALL sqlite3_result_value(sqlite3_context*, sqlite3_value*); |
| 4874 | SQLITE_API void SQLITE_APICALL sqlite3_result_zeroblob(sqlite3_context*, int n); |
| 4875 | SQLITE_API int SQLITE_APICALL sqlite3_result_zeroblob64(sqlite3_context*, sqlite3_uint64 n); |
| 4876 | |
| 4877 | |
| 4878 | /* |
| 4879 | ** CAPI3REF: Setting The Subtype Of An SQL Function |
| 4880 | ** METHOD: sqlite3_context |
| @@ -4876,11 +4885,11 @@ | |
| 4885 | ** of the subtype T are preserved in current versions of SQLite; |
| 4886 | ** higher order bits are discarded. |
| 4887 | ** The number of subtype bytes preserved by SQLite might increase |
| 4888 | ** in future releases of SQLite. |
| 4889 | */ |
| 4890 | SQLITE_API void SQLITE_APICALL sqlite3_result_subtype(sqlite3_context*,unsigned int); |
| 4891 | |
| 4892 | /* |
| 4893 | ** CAPI3REF: Define New Collating Sequences |
| 4894 | ** METHOD: sqlite3 |
| 4895 | ** |
| @@ -4958,31 +4967,31 @@ | |
| 4967 | ** is unfortunate but cannot be changed without breaking backwards |
| 4968 | ** compatibility. |
| 4969 | ** |
| 4970 | ** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. |
| 4971 | */ |
| 4972 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation( |
| 4973 | sqlite3*, |
| 4974 | const char *zName, |
| 4975 | int eTextRep, |
| 4976 | void *pArg, |
| 4977 | int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) |
| 4978 | ); |
| 4979 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation_v2( |
| 4980 | sqlite3*, |
| 4981 | const char *zName, |
| 4982 | int eTextRep, |
| 4983 | void *pArg, |
| 4984 | int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*), |
| 4985 | void(SQLITE_CALLBACK *xDestroy)(void*) |
| 4986 | ); |
| 4987 | SQLITE_API int SQLITE_APICALL sqlite3_create_collation16( |
| 4988 | sqlite3*, |
| 4989 | const void *zName, |
| 4990 | int eTextRep, |
| 4991 | void *pArg, |
| 4992 | int(SQLITE_CALLBACK *xCompare)(void*,int,const void*,int,const void*) |
| 4993 | ); |
| 4994 | |
| 4995 | /* |
| 4996 | ** CAPI3REF: Collation Needed Callbacks |
| 4997 | ** METHOD: sqlite3 |
| @@ -5008,19 +5017,19 @@ | |
| 5017 | ** |
| 5018 | ** The callback function should register the desired collation using |
| 5019 | ** [sqlite3_create_collation()], [sqlite3_create_collation16()], or |
| 5020 | ** [sqlite3_create_collation_v2()]. |
| 5021 | */ |
| 5022 | SQLITE_API int SQLITE_APICALL sqlite3_collation_needed( |
| 5023 | sqlite3*, |
| 5024 | void*, |
| 5025 | void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const char*) |
| 5026 | ); |
| 5027 | SQLITE_API int SQLITE_APICALL sqlite3_collation_needed16( |
| 5028 | sqlite3*, |
| 5029 | void*, |
| 5030 | void(SQLITE_CALLBACK *)(void*,sqlite3*,int eTextRep,const void*) |
| 5031 | ); |
| 5032 | |
| 5033 | #ifdef SQLITE_HAS_CODEC |
| 5034 | /* |
| 5035 | ** Specify the key for an encrypted database. This routine should be |
| @@ -5027,15 +5036,15 @@ | |
| 5036 | ** called right after sqlite3_open(). |
| 5037 | ** |
| 5038 | ** The code to implement this API is not available in the public release |
| 5039 | ** of SQLite. |
| 5040 | */ |
| 5041 | SQLITE_API int SQLITE_APICALL sqlite3_key( |
| 5042 | sqlite3 *db, /* Database to be rekeyed */ |
| 5043 | const void *pKey, int nKey /* The key */ |
| 5044 | ); |
| 5045 | SQLITE_API int SQLITE_APICALL sqlite3_key_v2( |
| 5046 | sqlite3 *db, /* Database to be rekeyed */ |
| 5047 | const char *zDbName, /* Name of the database */ |
| 5048 | const void *pKey, int nKey /* The key */ |
| 5049 | ); |
| 5050 | |
| @@ -5045,35 +5054,35 @@ | |
| 5054 | ** database is decrypted. |
| 5055 | ** |
| 5056 | ** The code to implement this API is not available in the public release |
| 5057 | ** of SQLite. |
| 5058 | */ |
| 5059 | SQLITE_API int SQLITE_APICALL sqlite3_rekey( |
| 5060 | sqlite3 *db, /* Database to be rekeyed */ |
| 5061 | const void *pKey, int nKey /* The new key */ |
| 5062 | ); |
| 5063 | SQLITE_API int SQLITE_APICALL sqlite3_rekey_v2( |
| 5064 | sqlite3 *db, /* Database to be rekeyed */ |
| 5065 | const char *zDbName, /* Name of the database */ |
| 5066 | const void *pKey, int nKey /* The new key */ |
| 5067 | ); |
| 5068 | |
| 5069 | /* |
| 5070 | ** Specify the activation key for a SEE database. Unless |
| 5071 | ** activated, none of the SEE routines will work. |
| 5072 | */ |
| 5073 | SQLITE_API void SQLITE_APICALL sqlite3_activate_see( |
| 5074 | const char *zPassPhrase /* Activation phrase */ |
| 5075 | ); |
| 5076 | #endif |
| 5077 | |
| 5078 | #ifdef SQLITE_ENABLE_CEROD |
| 5079 | /* |
| 5080 | ** Specify the activation key for a CEROD database. Unless |
| 5081 | ** activated, none of the CEROD routines will work. |
| 5082 | */ |
| 5083 | SQLITE_API void SQLITE_APICALL sqlite3_activate_cerod( |
| 5084 | const char *zPassPhrase /* Activation phrase */ |
| 5085 | ); |
| 5086 | #endif |
| 5087 | |
| 5088 | /* |
| @@ -5091,11 +5100,11 @@ | |
| 5100 | ** method of the default [sqlite3_vfs] object. If the xSleep() method |
| 5101 | ** of the default VFS is not implemented correctly, or not implemented at |
| 5102 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 5103 | ** in the previous paragraphs. |
| 5104 | */ |
| 5105 | SQLITE_API int SQLITE_APICALL sqlite3_sleep(int); |
| 5106 | |
| 5107 | /* |
| 5108 | ** CAPI3REF: Name Of The Folder Holding Temporary Files |
| 5109 | ** |
| 5110 | ** ^(If this global variable is made to point to a string which is |
| @@ -5210,11 +5219,11 @@ | |
| 5219 | ** |
| 5220 | ** If another thread changes the autocommit status of the database |
| 5221 | ** connection while this routine is running, then the return value |
| 5222 | ** is undefined. |
| 5223 | */ |
| 5224 | SQLITE_API int SQLITE_APICALL sqlite3_get_autocommit(sqlite3*); |
| 5225 | |
| 5226 | /* |
| 5227 | ** CAPI3REF: Find The Database Handle Of A Prepared Statement |
| 5228 | ** METHOD: sqlite3_stmt |
| 5229 | ** |
| @@ -5223,11 +5232,11 @@ | |
| 5232 | ** returned by sqlite3_db_handle is the same [database connection] |
| 5233 | ** that was the first argument |
| 5234 | ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to |
| 5235 | ** create the statement in the first place. |
| 5236 | */ |
| 5237 | SQLITE_API sqlite3 *SQLITE_APICALL sqlite3_db_handle(sqlite3_stmt*); |
| 5238 | |
| 5239 | /* |
| 5240 | ** CAPI3REF: Return The Filename For A Database Connection |
| 5241 | ** METHOD: sqlite3 |
| 5242 | ** |
| @@ -5240,21 +5249,21 @@ | |
| 5249 | ** ^The filename returned by this function is the output of the |
| 5250 | ** xFullPathname method of the [VFS]. ^In other words, the filename |
| 5251 | ** will be an absolute pathname, even if the filename used |
| 5252 | ** to open the database originally was a URI or relative pathname. |
| 5253 | */ |
| 5254 | SQLITE_API const char *SQLITE_APICALL sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 5255 | |
| 5256 | /* |
| 5257 | ** CAPI3REF: Determine if a database is read-only |
| 5258 | ** METHOD: sqlite3 |
| 5259 | ** |
| 5260 | ** ^The sqlite3_db_readonly(D,N) interface returns 1 if the database N |
| 5261 | ** of connection D is read-only, 0 if it is read/write, or -1 if N is not |
| 5262 | ** the name of a database on connection D. |
| 5263 | */ |
| 5264 | SQLITE_API int SQLITE_APICALL sqlite3_db_readonly(sqlite3 *db, const char *zDbName); |
| 5265 | |
| 5266 | /* |
| 5267 | ** CAPI3REF: Find the next prepared statement |
| 5268 | ** METHOD: sqlite3 |
| 5269 | ** |
| @@ -5266,11 +5275,11 @@ | |
| 5275 | ** |
| 5276 | ** The [database connection] pointer D in a call to |
| 5277 | ** [sqlite3_next_stmt(D,S)] must refer to an open database |
| 5278 | ** connection and in particular must not be a NULL pointer. |
| 5279 | */ |
| 5280 | SQLITE_API sqlite3_stmt *SQLITE_APICALL sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt); |
| 5281 | |
| 5282 | /* |
| 5283 | ** CAPI3REF: Commit And Rollback Notification Callbacks |
| 5284 | ** METHOD: sqlite3 |
| 5285 | ** |
| @@ -5315,12 +5324,12 @@ | |
| 5324 | ** ^The rollback callback is not invoked if a transaction is |
| 5325 | ** automatically rolled back because the database connection is closed. |
| 5326 | ** |
| 5327 | ** See also the [sqlite3_update_hook()] interface. |
| 5328 | */ |
| 5329 | SQLITE_API void *SQLITE_APICALL sqlite3_commit_hook(sqlite3*, int(SQLITE_CALLBACK *)(void*), void*); |
| 5330 | SQLITE_API void *SQLITE_APICALL sqlite3_rollback_hook(sqlite3*, void(SQLITE_CALLBACK *)(void *), void*); |
| 5331 | |
| 5332 | /* |
| 5333 | ** CAPI3REF: Data Change Notification Callbacks |
| 5334 | ** METHOD: sqlite3 |
| 5335 | ** |
| @@ -5367,13 +5376,13 @@ | |
| 5376 | ** the first call on D. |
| 5377 | ** |
| 5378 | ** See also the [sqlite3_commit_hook()], [sqlite3_rollback_hook()], |
| 5379 | ** and [sqlite3_preupdate_hook()] interfaces. |
| 5380 | */ |
| 5381 | SQLITE_API void *SQLITE_APICALL sqlite3_update_hook( |
| 5382 | sqlite3*, |
| 5383 | void(SQLITE_CALLBACK *)(void *,int ,char const *,char const *,sqlite3_int64), |
| 5384 | void* |
| 5385 | ); |
| 5386 | |
| 5387 | /* |
| 5388 | ** CAPI3REF: Enable Or Disable Shared Pager Cache |
| @@ -5407,11 +5416,11 @@ | |
| 5416 | ** This interface is threadsafe on processors where writing a |
| 5417 | ** 32-bit integer is atomic. |
| 5418 | ** |
| 5419 | ** See Also: [SQLite Shared-Cache Mode] |
| 5420 | */ |
| 5421 | SQLITE_API int SQLITE_APICALL sqlite3_enable_shared_cache(int); |
| 5422 | |
| 5423 | /* |
| 5424 | ** CAPI3REF: Attempt To Free Heap Memory |
| 5425 | ** |
| 5426 | ** ^The sqlite3_release_memory() interface attempts to free N bytes |
| @@ -5423,11 +5432,11 @@ | |
| 5432 | ** ^The sqlite3_release_memory() routine is a no-op returning zero |
| 5433 | ** if SQLite is not compiled with [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5434 | ** |
| 5435 | ** See also: [sqlite3_db_release_memory()] |
| 5436 | */ |
| 5437 | SQLITE_API int SQLITE_APICALL sqlite3_release_memory(int); |
| 5438 | |
| 5439 | /* |
| 5440 | ** CAPI3REF: Free Memory Used By A Database Connection |
| 5441 | ** METHOD: sqlite3 |
| 5442 | ** |
| @@ -5437,11 +5446,11 @@ | |
| 5446 | ** when the [SQLITE_ENABLE_MEMORY_MANAGEMENT] compile-time option is |
| 5447 | ** omitted. |
| 5448 | ** |
| 5449 | ** See also: [sqlite3_release_memory()] |
| 5450 | */ |
| 5451 | SQLITE_API int SQLITE_APICALL sqlite3_db_release_memory(sqlite3*); |
| 5452 | |
| 5453 | /* |
| 5454 | ** CAPI3REF: Impose A Limit On Heap Size |
| 5455 | ** |
| 5456 | ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the |
| @@ -5489,11 +5498,11 @@ | |
| 5498 | ** the use of [SQLITE_ENABLE_MEMORY_MANAGEMENT]. |
| 5499 | ** |
| 5500 | ** The circumstances under which SQLite will enforce the soft heap limit may |
| 5501 | ** changes in future releases of SQLite. |
| 5502 | */ |
| 5503 | SQLITE_API sqlite3_int64 SQLITE_APICALL sqlite3_soft_heap_limit64(sqlite3_int64 N); |
| 5504 | |
| 5505 | /* |
| 5506 | ** CAPI3REF: Deprecated Soft Heap Limit Interface |
| 5507 | ** DEPRECATED |
| 5508 | ** |
| @@ -5500,11 +5509,11 @@ | |
| 5509 | ** This is a deprecated version of the [sqlite3_soft_heap_limit64()] |
| 5510 | ** interface. This routine is provided for historical compatibility |
| 5511 | ** only. All new applications should use the |
| 5512 | ** [sqlite3_soft_heap_limit64()] interface rather than this one. |
| 5513 | */ |
| 5514 | SQLITE_API SQLITE_DEPRECATED void SQLITE_APICALL sqlite3_soft_heap_limit(int N); |
| 5515 | |
| 5516 | |
| 5517 | /* |
| 5518 | ** CAPI3REF: Extract Metadata About A Column Of A Table |
| 5519 | ** METHOD: sqlite3 |
| @@ -5570,11 +5579,11 @@ | |
| 5579 | ** |
| 5580 | ** ^This function causes all database schemas to be read from disk and |
| 5581 | ** parsed, if that has not already been done, and returns an error if |
| 5582 | ** any errors are encountered while loading the schema. |
| 5583 | */ |
| 5584 | SQLITE_API int SQLITE_APICALL sqlite3_table_column_metadata( |
| 5585 | sqlite3 *db, /* Connection handle */ |
| 5586 | const char *zDbName, /* Database name or NULL */ |
| 5587 | const char *zTableName, /* Table name */ |
| 5588 | const char *zColumnName, /* Column name */ |
| 5589 | char const **pzDataType, /* OUTPUT: Declared data type */ |
| @@ -5626,11 +5635,11 @@ | |
| 5635 | ** disabled and prevent SQL injections from giving attackers |
| 5636 | ** access to extension loading capabilities. |
| 5637 | ** |
| 5638 | ** See also the [load_extension() SQL function]. |
| 5639 | */ |
| 5640 | SQLITE_API int SQLITE_APICALL sqlite3_load_extension( |
| 5641 | sqlite3 *db, /* Load the extension into this database connection */ |
| 5642 | const char *zFile, /* Name of the shared library containing extension */ |
| 5643 | const char *zProc, /* Entry point. Derived from zFile if 0 */ |
| 5644 | char **pzErrMsg /* Put error message here if not 0 */ |
| 5645 | ); |
| @@ -5658,11 +5667,11 @@ | |
| 5667 | ** be disabled using the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method |
| 5668 | ** rather than this interface, so the [load_extension()] SQL function |
| 5669 | ** remains disabled. This will prevent SQL injections from giving attackers |
| 5670 | ** access to extension loading capabilities. |
| 5671 | */ |
| 5672 | SQLITE_API int SQLITE_APICALL sqlite3_enable_load_extension(sqlite3 *db, int onoff); |
| 5673 | |
| 5674 | /* |
| 5675 | ** CAPI3REF: Automatically Load Statically Linked Extensions |
| 5676 | ** |
| 5677 | ** ^This interface causes the xEntryPoint() function to be invoked for |
| @@ -5696,11 +5705,14 @@ | |
| 5705 | ** will be called more than once for each database connection that is opened. |
| 5706 | ** |
| 5707 | ** See also: [sqlite3_reset_auto_extension()] |
| 5708 | ** and [sqlite3_cancel_auto_extension()] |
| 5709 | */ |
| 5710 | typedef struct sqlite3_api_routines sqlite3_api_routines; |
| 5711 | SQLITE_API int SQLITE_APICALL sqlite3_auto_extension( |
| 5712 | int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 5713 | ); |
| 5714 | |
| 5715 | /* |
| 5716 | ** CAPI3REF: Cancel Automatic Extension Loading |
| 5717 | ** |
| 5718 | ** ^The [sqlite3_cancel_auto_extension(X)] interface unregisters the |
| @@ -5708,19 +5720,21 @@ | |
| 5720 | ** [sqlite3_auto_extension(X)]. ^The [sqlite3_cancel_auto_extension(X)] |
| 5721 | ** routine returns 1 if initialization routine X was successfully |
| 5722 | ** unregistered and it returns 0 if X was not on the list of initialization |
| 5723 | ** routines. |
| 5724 | */ |
| 5725 | SQLITE_API int SQLITE_APICALL sqlite3_cancel_auto_extension( |
| 5726 | int (SQLITE_CALLBACK *xEntryPoint)(sqlite3 *, char **, const sqlite3_api_routines *) |
| 5727 | ); |
| 5728 | |
| 5729 | /* |
| 5730 | ** CAPI3REF: Reset Automatic Extension Loading |
| 5731 | ** |
| 5732 | ** ^This interface disables all automatic extensions previously |
| 5733 | ** registered using [sqlite3_auto_extension()]. |
| 5734 | */ |
| 5735 | SQLITE_API void SQLITE_APICALL sqlite3_reset_auto_extension(void); |
| 5736 | |
| 5737 | /* |
| 5738 | ** The interface to the virtual-table mechanism is currently considered |
| 5739 | ** to be experimental. The interface might change in incompatible ways. |
| 5740 | ** If this is a problem for you, do not use the interface at this time. |
| @@ -5753,41 +5767,41 @@ | |
| 5767 | ** of this structure must not change while it is registered with |
| 5768 | ** any database connection. |
| 5769 | */ |
| 5770 | struct sqlite3_module { |
| 5771 | int iVersion; |
| 5772 | int (SQLITE_CALLBACK *xCreate)(sqlite3*, void *pAux, |
| 5773 | int argc, const char *const*argv, |
| 5774 | sqlite3_vtab **ppVTab, char**); |
| 5775 | int (SQLITE_CALLBACK *xConnect)(sqlite3*, void *pAux, |
| 5776 | int argc, const char *const*argv, |
| 5777 | sqlite3_vtab **ppVTab, char**); |
| 5778 | int (SQLITE_CALLBACK *xBestIndex)(sqlite3_vtab *pVTab, sqlite3_index_info*); |
| 5779 | int (SQLITE_CALLBACK *xDisconnect)(sqlite3_vtab *pVTab); |
| 5780 | int (SQLITE_CALLBACK *xDestroy)(sqlite3_vtab *pVTab); |
| 5781 | int (SQLITE_CALLBACK *xOpen)(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor); |
| 5782 | int (SQLITE_CALLBACK *xClose)(sqlite3_vtab_cursor*); |
| 5783 | int (SQLITE_CALLBACK *xFilter)(sqlite3_vtab_cursor*, int idxNum, const char *idxStr, |
| 5784 | int argc, sqlite3_value **argv); |
| 5785 | int (SQLITE_CALLBACK *xNext)(sqlite3_vtab_cursor*); |
| 5786 | int (SQLITE_CALLBACK *xEof)(sqlite3_vtab_cursor*); |
| 5787 | int (SQLITE_CALLBACK *xColumn)(sqlite3_vtab_cursor*, sqlite3_context*, int); |
| 5788 | int (SQLITE_CALLBACK *xRowid)(sqlite3_vtab_cursor*, sqlite3_int64 *pRowid); |
| 5789 | int (SQLITE_CALLBACK *xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *); |
| 5790 | int (SQLITE_CALLBACK *xBegin)(sqlite3_vtab *pVTab); |
| 5791 | int (SQLITE_CALLBACK *xSync)(sqlite3_vtab *pVTab); |
| 5792 | int (SQLITE_CALLBACK *xCommit)(sqlite3_vtab *pVTab); |
| 5793 | int (SQLITE_CALLBACK *xRollback)(sqlite3_vtab *pVTab); |
| 5794 | int (SQLITE_CALLBACK *xFindFunction)(sqlite3_vtab *pVtab, int nArg, const char *zName, |
| 5795 | void (SQLITE_CALLBACK **pxFunc)(sqlite3_context*,int,sqlite3_value**), |
| 5796 | void **ppArg); |
| 5797 | int (SQLITE_CALLBACK *xRename)(sqlite3_vtab *pVtab, const char *zNew); |
| 5798 | /* The methods above are in version 1 of the sqlite_module object. Those |
| 5799 | ** below are for version 2 and greater. */ |
| 5800 | int (SQLITE_CALLBACK *xSavepoint)(sqlite3_vtab *pVTab, int); |
| 5801 | int (SQLITE_CALLBACK *xRelease)(sqlite3_vtab *pVTab, int); |
| 5802 | int (SQLITE_CALLBACK *xRollbackTo)(sqlite3_vtab *pVTab, int); |
| 5803 | }; |
| 5804 | |
| 5805 | /* |
| 5806 | ** CAPI3REF: Virtual Table Indexing Information |
| 5807 | ** KEYWORDS: sqlite3_index_info |
| @@ -5961,22 +5975,22 @@ | |
| 5975 | ** be invoked if the call to sqlite3_create_module_v2() fails. |
| 5976 | ** ^The sqlite3_create_module() |
| 5977 | ** interface is equivalent to sqlite3_create_module_v2() with a NULL |
| 5978 | ** destructor. |
| 5979 | */ |
| 5980 | SQLITE_API int SQLITE_APICALL sqlite3_create_module( |
| 5981 | sqlite3 *db, /* SQLite connection to register module with */ |
| 5982 | const char *zName, /* Name of the module */ |
| 5983 | const sqlite3_module *p, /* Methods for the module */ |
| 5984 | void *pClientData /* Client data for xCreate/xConnect */ |
| 5985 | ); |
| 5986 | SQLITE_API int SQLITE_APICALL sqlite3_create_module_v2( |
| 5987 | sqlite3 *db, /* SQLite connection to register module with */ |
| 5988 | const char *zName, /* Name of the module */ |
| 5989 | const sqlite3_module *p, /* Methods for the module */ |
| 5990 | void *pClientData, /* Client data for xCreate/xConnect */ |
| 5991 | void(SQLITE_CALLBACK *xDestroy)(void*) /* Module destructor function */ |
| 5992 | ); |
| 5993 | |
| 5994 | /* |
| 5995 | ** CAPI3REF: Virtual Table Instance Object |
| 5996 | ** KEYWORDS: sqlite3_vtab |
| @@ -6030,11 +6044,11 @@ | |
| 6044 | ** ^The [xCreate] and [xConnect] methods of a |
| 6045 | ** [virtual table module] call this interface |
| 6046 | ** to declare the format (the names and datatypes of the columns) of |
| 6047 | ** the virtual tables they implement. |
| 6048 | */ |
| 6049 | SQLITE_API int SQLITE_APICALL sqlite3_declare_vtab(sqlite3*, const char *zSQL); |
| 6050 | |
| 6051 | /* |
| 6052 | ** CAPI3REF: Overload A Function For A Virtual Table |
| 6053 | ** METHOD: sqlite3 |
| 6054 | ** |
| @@ -6049,11 +6063,11 @@ | |
| 6063 | ** of the new function always causes an exception to be thrown. So |
| 6064 | ** the new function is not good for anything by itself. Its only |
| 6065 | ** purpose is to be a placeholder function that can be overloaded |
| 6066 | ** by a [virtual table]. |
| 6067 | */ |
| 6068 | SQLITE_API int SQLITE_APICALL sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 6069 | |
| 6070 | /* |
| 6071 | ** The interface to the virtual-table mechanism defined above (back up |
| 6072 | ** to a comment remarkably similar to this one) is currently considered |
| 6073 | ** to be experimental. The interface might change in incompatible ways. |
| @@ -6148,11 +6162,11 @@ | |
| 6162 | ** zero-filled blob to read or write using the incremental-blob interface. |
| 6163 | ** |
| 6164 | ** To avoid a resource leak, every open [BLOB handle] should eventually |
| 6165 | ** be released by a call to [sqlite3_blob_close()]. |
| 6166 | */ |
| 6167 | SQLITE_API int SQLITE_APICALL sqlite3_blob_open( |
| 6168 | sqlite3*, |
| 6169 | const char *zDb, |
| 6170 | const char *zTable, |
| 6171 | const char *zColumn, |
| 6172 | sqlite3_int64 iRow, |
| @@ -6181,11 +6195,11 @@ | |
| 6195 | ** SQLITE_ABORT. ^Calling [sqlite3_blob_bytes()] on an aborted blob handle |
| 6196 | ** always returns zero. |
| 6197 | ** |
| 6198 | ** ^This function sets the database handle error code and message. |
| 6199 | */ |
| 6200 | SQLITE_API int SQLITE_APICALL sqlite3_blob_reopen(sqlite3_blob *, sqlite3_int64); |
| 6201 | |
| 6202 | /* |
| 6203 | ** CAPI3REF: Close A BLOB Handle |
| 6204 | ** DESTRUCTOR: sqlite3_blob |
| 6205 | ** |
| @@ -6204,11 +6218,11 @@ | |
| 6218 | ** with a null pointer (such as would be returned by a failed call to |
| 6219 | ** [sqlite3_blob_open()]) is a harmless no-op. ^Otherwise, if this function |
| 6220 | ** is passed a valid open blob handle, the values returned by the |
| 6221 | ** sqlite3_errcode() and sqlite3_errmsg() functions are set before returning. |
| 6222 | */ |
| 6223 | SQLITE_API int SQLITE_APICALL sqlite3_blob_close(sqlite3_blob *); |
| 6224 | |
| 6225 | /* |
| 6226 | ** CAPI3REF: Return The Size Of An Open BLOB |
| 6227 | ** METHOD: sqlite3_blob |
| 6228 | ** |
| @@ -6220,11 +6234,11 @@ | |
| 6234 | ** This routine only works on a [BLOB handle] which has been created |
| 6235 | ** by a prior successful call to [sqlite3_blob_open()] and which has not |
| 6236 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6237 | ** to this routine results in undefined and probably undesirable behavior. |
| 6238 | */ |
| 6239 | SQLITE_API int SQLITE_APICALL sqlite3_blob_bytes(sqlite3_blob *); |
| 6240 | |
| 6241 | /* |
| 6242 | ** CAPI3REF: Read Data From A BLOB Incrementally |
| 6243 | ** METHOD: sqlite3_blob |
| 6244 | ** |
| @@ -6249,11 +6263,11 @@ | |
| 6263 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6264 | ** to this routine results in undefined and probably undesirable behavior. |
| 6265 | ** |
| 6266 | ** See also: [sqlite3_blob_write()]. |
| 6267 | */ |
| 6268 | SQLITE_API int SQLITE_APICALL sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); |
| 6269 | |
| 6270 | /* |
| 6271 | ** CAPI3REF: Write Data Into A BLOB Incrementally |
| 6272 | ** METHOD: sqlite3_blob |
| 6273 | ** |
| @@ -6291,11 +6305,11 @@ | |
| 6305 | ** been closed by [sqlite3_blob_close()]. Passing any other pointer in |
| 6306 | ** to this routine results in undefined and probably undesirable behavior. |
| 6307 | ** |
| 6308 | ** See also: [sqlite3_blob_read()]. |
| 6309 | */ |
| 6310 | SQLITE_API int SQLITE_APICALL sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); |
| 6311 | |
| 6312 | /* |
| 6313 | ** CAPI3REF: Virtual File System Objects |
| 6314 | ** |
| 6315 | ** A virtual filesystem (VFS) is an [sqlite3_vfs] object |
| @@ -6322,13 +6336,13 @@ | |
| 6336 | ** |
| 6337 | ** ^Unregister a VFS with the sqlite3_vfs_unregister() interface. |
| 6338 | ** ^(If the default VFS is unregistered, another VFS is chosen as |
| 6339 | ** the default. The choice for the new VFS is arbitrary.)^ |
| 6340 | */ |
| 6341 | SQLITE_API sqlite3_vfs *SQLITE_APICALL sqlite3_vfs_find(const char *zVfsName); |
| 6342 | SQLITE_API int SQLITE_APICALL sqlite3_vfs_register(sqlite3_vfs*, int makeDflt); |
| 6343 | SQLITE_API int SQLITE_APICALL sqlite3_vfs_unregister(sqlite3_vfs*); |
| 6344 | |
| 6345 | /* |
| 6346 | ** CAPI3REF: Mutexes |
| 6347 | ** |
| 6348 | ** The SQLite core uses these routines for thread |
| @@ -6440,15 +6454,15 @@ | |
| 6454 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines |
| 6455 | ** behave as no-ops. |
| 6456 | ** |
| 6457 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 6458 | */ |
| 6459 | SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_mutex_alloc(int); |
| 6460 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_free(sqlite3_mutex*); |
| 6461 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_enter(sqlite3_mutex*); |
| 6462 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_try(sqlite3_mutex*); |
| 6463 | SQLITE_API void SQLITE_APICALL sqlite3_mutex_leave(sqlite3_mutex*); |
| 6464 | |
| 6465 | /* |
| 6466 | ** CAPI3REF: Mutex Methods Object |
| 6467 | ** |
| 6468 | ** An instance of this structure defines the low-level routines |
| @@ -6513,19 +6527,19 @@ | |
| 6527 | ** If xMutexInit fails in any way, it is expected to clean up after itself |
| 6528 | ** prior to returning. |
| 6529 | */ |
| 6530 | typedef struct sqlite3_mutex_methods sqlite3_mutex_methods; |
| 6531 | struct sqlite3_mutex_methods { |
| 6532 | int (SQLITE_CALLBACK *xMutexInit)(void); |
| 6533 | int (SQLITE_CALLBACK *xMutexEnd)(void); |
| 6534 | sqlite3_mutex *(SQLITE_CALLBACK *xMutexAlloc)(int); |
| 6535 | void (SQLITE_CALLBACK *xMutexFree)(sqlite3_mutex *); |
| 6536 | void (SQLITE_CALLBACK *xMutexEnter)(sqlite3_mutex *); |
| 6537 | int (SQLITE_CALLBACK *xMutexTry)(sqlite3_mutex *); |
| 6538 | void (SQLITE_CALLBACK *xMutexLeave)(sqlite3_mutex *); |
| 6539 | int (SQLITE_CALLBACK *xMutexHeld)(sqlite3_mutex *); |
| 6540 | int (SQLITE_CALLBACK *xMutexNotheld)(sqlite3_mutex *); |
| 6541 | }; |
| 6542 | |
| 6543 | /* |
| 6544 | ** CAPI3REF: Mutex Verification Routines |
| 6545 | ** |
| @@ -6554,12 +6568,12 @@ | |
| 6568 | ** call to sqlite3_mutex_held() to fail, so a non-zero return is |
| 6569 | ** the appropriate thing to do. The sqlite3_mutex_notheld() |
| 6570 | ** interface should also return 1 when given a NULL pointer. |
| 6571 | */ |
| 6572 | #ifndef NDEBUG |
| 6573 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_held(sqlite3_mutex*); |
| 6574 | SQLITE_API int SQLITE_APICALL sqlite3_mutex_notheld(sqlite3_mutex*); |
| 6575 | #endif |
| 6576 | |
| 6577 | /* |
| 6578 | ** CAPI3REF: Mutex Types |
| 6579 | ** |
| @@ -6595,11 +6609,11 @@ | |
| 6609 | ** serializes access to the [database connection] given in the argument |
| 6610 | ** when the [threading mode] is Serialized. |
| 6611 | ** ^If the [threading mode] is Single-thread or Multi-thread then this |
| 6612 | ** routine returns a NULL pointer. |
| 6613 | */ |
| 6614 | SQLITE_API sqlite3_mutex *SQLITE_APICALL sqlite3_db_mutex(sqlite3*); |
| 6615 | |
| 6616 | /* |
| 6617 | ** CAPI3REF: Low-Level Control Of Database Files |
| 6618 | ** METHOD: sqlite3 |
| 6619 | ** |
| @@ -6630,11 +6644,11 @@ | |
| 6644 | ** an incorrect zDbName and an SQLITE_ERROR return from the underlying |
| 6645 | ** xFileControl method. |
| 6646 | ** |
| 6647 | ** See also: [SQLITE_FCNTL_LOCKSTATE] |
| 6648 | */ |
| 6649 | SQLITE_API int SQLITE_APICALL sqlite3_file_control(sqlite3*, const char *zDbName, int op, void*); |
| 6650 | |
| 6651 | /* |
| 6652 | ** CAPI3REF: Testing Interface |
| 6653 | ** |
| 6654 | ** ^The sqlite3_test_control() interface is used to read out internal |
| @@ -6712,12 +6726,12 @@ | |
| 6726 | ** be represented by a 32-bit integer, then the values returned by |
| 6727 | ** sqlite3_status() are undefined. |
| 6728 | ** |
| 6729 | ** See also: [sqlite3_db_status()] |
| 6730 | */ |
| 6731 | SQLITE_API int SQLITE_APICALL sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag); |
| 6732 | SQLITE_API int SQLITE_APICALL sqlite3_status64( |
| 6733 | int op, |
| 6734 | sqlite3_int64 *pCurrent, |
| 6735 | sqlite3_int64 *pHighwater, |
| 6736 | int resetFlag |
| 6737 | ); |
| @@ -6838,11 +6852,11 @@ | |
| 6852 | ** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a |
| 6853 | ** non-zero [error code] on failure. |
| 6854 | ** |
| 6855 | ** See also: [sqlite3_status()] and [sqlite3_stmt_status()]. |
| 6856 | */ |
| 6857 | SQLITE_API int SQLITE_APICALL sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg); |
| 6858 | |
| 6859 | /* |
| 6860 | ** CAPI3REF: Status Parameters for database connections |
| 6861 | ** KEYWORDS: {SQLITE_DBSTATUS options} |
| 6862 | ** |
| @@ -6981,11 +6995,11 @@ | |
| 6995 | ** ^If the resetFlg is true, then the counter is reset to zero after this |
| 6996 | ** interface call returns. |
| 6997 | ** |
| 6998 | ** See also: [sqlite3_status()] and [sqlite3_db_status()]. |
| 6999 | */ |
| 7000 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); |
| 7001 | |
| 7002 | /* |
| 7003 | ** CAPI3REF: Status Parameters for prepared statements |
| 7004 | ** KEYWORDS: {SQLITE_STMTSTATUS counter} {SQLITE_STMTSTATUS counters} |
| 7005 | ** |
| @@ -7217,22 +7231,22 @@ | |
| 7231 | */ |
| 7232 | typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2; |
| 7233 | struct sqlite3_pcache_methods2 { |
| 7234 | int iVersion; |
| 7235 | void *pArg; |
| 7236 | int (SQLITE_CALLBACK *xInit)(void*); |
| 7237 | void (SQLITE_CALLBACK *xShutdown)(void*); |
| 7238 | sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int szExtra, int bPurgeable); |
| 7239 | void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7240 | int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); |
| 7241 | sqlite3_pcache_page *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7242 | void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, sqlite3_pcache_page*, int discard); |
| 7243 | void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, sqlite3_pcache_page*, |
| 7244 | unsigned oldKey, unsigned newKey); |
| 7245 | void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7246 | void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); |
| 7247 | void (SQLITE_CALLBACK *xShrink)(sqlite3_pcache*); |
| 7248 | }; |
| 7249 | |
| 7250 | /* |
| 7251 | ** This is the obsolete pcache_methods object that has now been replaced |
| 7252 | ** by sqlite3_pcache_methods2. This object is not used by SQLite. It is |
| @@ -7239,20 +7253,20 @@ | |
| 7253 | ** retained in the header file for backwards compatibility only. |
| 7254 | */ |
| 7255 | typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; |
| 7256 | struct sqlite3_pcache_methods { |
| 7257 | void *pArg; |
| 7258 | int (SQLITE_CALLBACK *xInit)(void*); |
| 7259 | void (SQLITE_CALLBACK *xShutdown)(void*); |
| 7260 | sqlite3_pcache *(SQLITE_CALLBACK *xCreate)(int szPage, int bPurgeable); |
| 7261 | void (SQLITE_CALLBACK *xCachesize)(sqlite3_pcache*, int nCachesize); |
| 7262 | int (SQLITE_CALLBACK *xPagecount)(sqlite3_pcache*); |
| 7263 | void *(SQLITE_CALLBACK *xFetch)(sqlite3_pcache*, unsigned key, int createFlag); |
| 7264 | void (SQLITE_CALLBACK *xUnpin)(sqlite3_pcache*, void*, int discard); |
| 7265 | void (SQLITE_CALLBACK *xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); |
| 7266 | void (SQLITE_CALLBACK *xTruncate)(sqlite3_pcache*, unsigned iLimit); |
| 7267 | void (SQLITE_CALLBACK *xDestroy)(sqlite3_pcache*); |
| 7268 | }; |
| 7269 | |
| 7270 | |
| 7271 | /* |
| 7272 | ** CAPI3REF: Online Backup Object |
| @@ -7450,20 +7464,20 @@ | |
| 7464 | ** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() |
| 7465 | ** APIs are not strictly speaking threadsafe. If they are invoked at the |
| 7466 | ** same time as another thread is invoking sqlite3_backup_step() it is |
| 7467 | ** possible that they return invalid values. |
| 7468 | */ |
| 7469 | SQLITE_API sqlite3_backup *SQLITE_APICALL sqlite3_backup_init( |
| 7470 | sqlite3 *pDest, /* Destination database handle */ |
| 7471 | const char *zDestName, /* Destination database name */ |
| 7472 | sqlite3 *pSource, /* Source database handle */ |
| 7473 | const char *zSourceName /* Source database name */ |
| 7474 | ); |
| 7475 | SQLITE_API int SQLITE_APICALL sqlite3_backup_step(sqlite3_backup *p, int nPage); |
| 7476 | SQLITE_API int SQLITE_APICALL sqlite3_backup_finish(sqlite3_backup *p); |
| 7477 | SQLITE_API int SQLITE_APICALL sqlite3_backup_remaining(sqlite3_backup *p); |
| 7478 | SQLITE_API int SQLITE_APICALL sqlite3_backup_pagecount(sqlite3_backup *p); |
| 7479 | |
| 7480 | /* |
| 7481 | ** CAPI3REF: Unlock Notification |
| 7482 | ** METHOD: sqlite3 |
| 7483 | ** |
| @@ -7576,13 +7590,13 @@ | |
| 7590 | ** by an sqlite3_step() call. ^(If there is a blocking connection, then the |
| 7591 | ** extended error code is set to SQLITE_LOCKED_SHAREDCACHE. Otherwise, in |
| 7592 | ** the special "DROP TABLE/INDEX" case, the extended error code is just |
| 7593 | ** SQLITE_LOCKED.)^ |
| 7594 | */ |
| 7595 | SQLITE_API int SQLITE_APICALL sqlite3_unlock_notify( |
| 7596 | sqlite3 *pBlocked, /* Waiting connection */ |
| 7597 | void (SQLITE_CALLBACK *xNotify)(void **apArg, int nArg), /* Callback function to invoke */ |
| 7598 | void *pNotifyArg /* Argument to pass to xNotify */ |
| 7599 | ); |
| 7600 | |
| 7601 | |
| 7602 | /* |
| @@ -7591,12 +7605,12 @@ | |
| 7605 | ** ^The [sqlite3_stricmp()] and [sqlite3_strnicmp()] APIs allow applications |
| 7606 | ** and extensions to compare the contents of two buffers containing UTF-8 |
| 7607 | ** strings in a case-independent fashion, using the same definition of "case |
| 7608 | ** independence" that SQLite uses internally when comparing identifiers. |
| 7609 | */ |
| 7610 | SQLITE_API int SQLITE_APICALL sqlite3_stricmp(const char *, const char *); |
| 7611 | SQLITE_API int SQLITE_APICALL sqlite3_strnicmp(const char *, const char *, int); |
| 7612 | |
| 7613 | /* |
| 7614 | ** CAPI3REF: String Globbing |
| 7615 | * |
| 7616 | ** ^The [sqlite3_strglob(P,X)] interface returns zero if and only if |
| @@ -7609,11 +7623,11 @@ | |
| 7623 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7624 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7625 | ** |
| 7626 | ** See also: [sqlite3_strlike()]. |
| 7627 | */ |
| 7628 | SQLITE_API int SQLITE_APICALL sqlite3_strglob(const char *zGlob, const char *zStr); |
| 7629 | |
| 7630 | /* |
| 7631 | ** CAPI3REF: String LIKE Matching |
| 7632 | * |
| 7633 | ** ^The [sqlite3_strlike(P,X,E)] interface returns zero if and only if |
| @@ -7632,11 +7646,11 @@ | |
| 7646 | ** Note that this routine returns zero on a match and non-zero if the strings |
| 7647 | ** do not match, the same as [sqlite3_stricmp()] and [sqlite3_strnicmp()]. |
| 7648 | ** |
| 7649 | ** See also: [sqlite3_strglob()]. |
| 7650 | */ |
| 7651 | SQLITE_API int SQLITE_APICALL sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc); |
| 7652 | |
| 7653 | /* |
| 7654 | ** CAPI3REF: Error Logging Interface |
| 7655 | ** |
| 7656 | ** ^The [sqlite3_log()] interface writes a message into the [error log] |
| @@ -7691,13 +7705,13 @@ | |
| 7705 | ** previously registered write-ahead log callback. ^Note that the |
| 7706 | ** [sqlite3_wal_autocheckpoint()] interface and the |
| 7707 | ** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and will |
| 7708 | ** overwrite any prior [sqlite3_wal_hook()] settings. |
| 7709 | */ |
| 7710 | SQLITE_API void *SQLITE_APICALL sqlite3_wal_hook( |
| 7711 | sqlite3*, |
| 7712 | int(SQLITE_CALLBACK *)(void *,sqlite3*,const char*,int), |
| 7713 | void* |
| 7714 | ); |
| 7715 | |
| 7716 | /* |
| 7717 | ** CAPI3REF: Configure an auto-checkpoint |
| @@ -7726,11 +7740,11 @@ | |
| 7740 | ** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT] |
| 7741 | ** pages. The use of this interface |
| 7742 | ** is only necessary if the default setting is found to be suboptimal |
| 7743 | ** for a particular application. |
| 7744 | */ |
| 7745 | SQLITE_API int SQLITE_APICALL sqlite3_wal_autocheckpoint(sqlite3 *db, int N); |
| 7746 | |
| 7747 | /* |
| 7748 | ** CAPI3REF: Checkpoint a database |
| 7749 | ** METHOD: sqlite3 |
| 7750 | ** |
| @@ -7748,11 +7762,11 @@ | |
| 7762 | ** interface was added. This interface is retained for backwards |
| 7763 | ** compatibility and as a convenience for applications that need to manually |
| 7764 | ** start a callback but which do not need the full power (and corresponding |
| 7765 | ** complication) of [sqlite3_wal_checkpoint_v2()]. |
| 7766 | */ |
| 7767 | SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb); |
| 7768 | |
| 7769 | /* |
| 7770 | ** CAPI3REF: Checkpoint a database |
| 7771 | ** METHOD: sqlite3 |
| 7772 | ** |
| @@ -7842,11 +7856,11 @@ | |
| 7856 | ** [sqlite3_errcode()] and [sqlite3_errmsg()]. |
| 7857 | ** |
| 7858 | ** ^The [PRAGMA wal_checkpoint] command can be used to invoke this interface |
| 7859 | ** from SQL. |
| 7860 | */ |
| 7861 | SQLITE_API int SQLITE_APICALL sqlite3_wal_checkpoint_v2( |
| 7862 | sqlite3 *db, /* Database handle */ |
| 7863 | const char *zDb, /* Name of attached database (or NULL) */ |
| 7864 | int eMode, /* SQLITE_CHECKPOINT_* value */ |
| 7865 | int *pnLog, /* OUT: Size of WAL log in frames */ |
| 7866 | int *pnCkpt /* OUT: Total number of frames checkpointed */ |
| @@ -7931,11 +7945,11 @@ | |
| 7945 | ** value returned is one of [SQLITE_ROLLBACK], [SQLITE_IGNORE], [SQLITE_FAIL], |
| 7946 | ** [SQLITE_ABORT], or [SQLITE_REPLACE], according to the [ON CONFLICT] mode |
| 7947 | ** of the SQL statement that triggered the call to the [xUpdate] method of the |
| 7948 | ** [virtual table]. |
| 7949 | */ |
| 7950 | SQLITE_API int SQLITE_APICALL sqlite3_vtab_on_conflict(sqlite3 *); |
| 7951 | |
| 7952 | /* |
| 7953 | ** CAPI3REF: Conflict resolution modes |
| 7954 | ** KEYWORDS: {conflict resolution mode} |
| 7955 | ** |
| @@ -8036,11 +8050,11 @@ | |
| 8050 | ** as if the loop did not exist - it returns non-zero and leave the variable |
| 8051 | ** that pOut points to unchanged. |
| 8052 | ** |
| 8053 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 8054 | */ |
| 8055 | SQLITE_API int SQLITE_APICALL sqlite3_stmt_scanstatus( |
| 8056 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ |
| 8057 | int idx, /* Index of loop to report on */ |
| 8058 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 8059 | void *pOut /* Result written here */ |
| 8060 | ); |
| @@ -8052,11 +8066,11 @@ | |
| 8066 | ** ^Zero all [sqlite3_stmt_scanstatus()] related event counters. |
| 8067 | ** |
| 8068 | ** This API is only available if the library is built with pre-processor |
| 8069 | ** symbol [SQLITE_ENABLE_STMT_SCANSTATUS] defined. |
| 8070 | */ |
| 8071 | SQLITE_API void SQLITE_APICALL sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); |
| 8072 | |
| 8073 | /* |
| 8074 | ** CAPI3REF: Flush caches to disk mid-transaction |
| 8075 | ** |
| 8076 | ** ^If a write-transaction is open on [database connection] D when the |
| @@ -8084,11 +8098,11 @@ | |
| 8098 | ** ^Otherwise, if no error occurs, [sqlite3_db_cacheflush()] returns SQLITE_OK. |
| 8099 | ** |
| 8100 | ** ^This function does not set the database handle error code or message |
| 8101 | ** returned by the [sqlite3_errcode()] and [sqlite3_errmsg()] functions. |
| 8102 | */ |
| 8103 | SQLITE_API int SQLITE_APICALL sqlite3_db_cacheflush(sqlite3*); |
| 8104 | |
| 8105 | /* |
| 8106 | ** CAPI3REF: The pre-update hook. |
| 8107 | ** |
| 8108 | ** ^These interfaces are only available if SQLite is compiled using the |
| @@ -8164,13 +8178,13 @@ | |
| 8178 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 8179 | ** triggers; and so forth. |
| 8180 | ** |
| 8181 | ** See also: [sqlite3_update_hook()] |
| 8182 | */ |
| 8183 | SQLITE_API SQLITE_EXPERIMENTAL void *SQLITE_APICALL sqlite3_preupdate_hook( |
| 8184 | sqlite3 *db, |
| 8185 | void(SQLITE_CALLBACK *xPreUpdate)( |
| 8186 | void *pCtx, /* Copy of third arg to preupdate_hook() */ |
| 8187 | sqlite3 *db, /* Database handle */ |
| 8188 | int op, /* SQLITE_UPDATE, DELETE or INSERT */ |
| 8189 | char const *zDb, /* Database name */ |
| 8190 | char const *zName, /* Table name */ |
| @@ -8177,14 +8191,14 @@ | |
| 8191 | sqlite3_int64 iKey1, /* Rowid of row about to be deleted/updated */ |
| 8192 | sqlite3_int64 iKey2 /* New rowid value (for a rowid UPDATE) */ |
| 8193 | ), |
| 8194 | void* |
| 8195 | ); |
| 8196 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); |
| 8197 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_count(sqlite3 *); |
| 8198 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_depth(sqlite3 *); |
| 8199 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 8200 | |
| 8201 | /* |
| 8202 | ** CAPI3REF: Low-level system error code |
| 8203 | ** |
| 8204 | ** ^Attempt to return the underlying operating system error code or error |
| @@ -8192,11 +8206,11 @@ | |
| 8206 | ** The return value is OS-dependent. For example, on unix systems, after |
| 8207 | ** [sqlite3_open_v2()] returns [SQLITE_CANTOPEN], this interface could be |
| 8208 | ** called to get back the underlying "errno" that caused the problem, such |
| 8209 | ** as ENOSPC, EAUTH, EISDIR, and so forth. |
| 8210 | */ |
| 8211 | SQLITE_API int SQLITE_APICALL sqlite3_system_errno(sqlite3*); |
| 8212 | |
| 8213 | /* |
| 8214 | ** CAPI3REF: Database Snapshot |
| 8215 | ** KEYWORDS: {snapshot} |
| 8216 | ** EXPERIMENTAL |
| @@ -8242,11 +8256,11 @@ | |
| 8256 | ** to avoid a memory leak. |
| 8257 | ** |
| 8258 | ** The [sqlite3_snapshot_get()] interface is only available when the |
| 8259 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8260 | */ |
| 8261 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_get( |
| 8262 | sqlite3 *db, |
| 8263 | const char *zSchema, |
| 8264 | sqlite3_snapshot **ppSnapshot |
| 8265 | ); |
| 8266 | |
| @@ -8280,11 +8294,11 @@ | |
| 8294 | ** database connection in order to make it ready to use snapshots.) |
| 8295 | ** |
| 8296 | ** The [sqlite3_snapshot_open()] interface is only available when the |
| 8297 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8298 | */ |
| 8299 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_open( |
| 8300 | sqlite3 *db, |
| 8301 | const char *zSchema, |
| 8302 | sqlite3_snapshot *pSnapshot |
| 8303 | ); |
| 8304 | |
| @@ -8297,11 +8311,11 @@ | |
| 8311 | ** using this routine to avoid a memory leak. |
| 8312 | ** |
| 8313 | ** The [sqlite3_snapshot_free()] interface is only available when the |
| 8314 | ** SQLITE_ENABLE_SNAPSHOT compile-time option is used. |
| 8315 | */ |
| 8316 | SQLITE_API SQLITE_EXPERIMENTAL void SQLITE_APICALL sqlite3_snapshot_free(sqlite3_snapshot*); |
| 8317 | |
| 8318 | /* |
| 8319 | ** CAPI3REF: Compare the ages of two snapshot handles. |
| 8320 | ** EXPERIMENTAL |
| 8321 | ** |
| @@ -8321,11 +8335,11 @@ | |
| 8335 | ** |
| 8336 | ** Otherwise, this API returns a negative value if P1 refers to an older |
| 8337 | ** snapshot than P2, zero if the two handles refer to the same database |
| 8338 | ** snapshot, and a positive value if P1 is a newer snapshot than P2. |
| 8339 | */ |
| 8340 | SQLITE_API SQLITE_EXPERIMENTAL int SQLITE_APICALL sqlite3_snapshot_cmp( |
| 8341 | sqlite3_snapshot *p1, |
| 8342 | sqlite3_snapshot *p2 |
| 8343 | ); |
| 8344 | |
| 8345 | /* |
| @@ -8379,14 +8393,14 @@ | |
| 8393 | ** Register a geometry callback named zGeom that can be used as part of an |
| 8394 | ** R-Tree geometry query as follows: |
| 8395 | ** |
| 8396 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zGeom(... params ...) |
| 8397 | */ |
| 8398 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_geometry_callback( |
| 8399 | sqlite3 *db, |
| 8400 | const char *zGeom, |
| 8401 | int (SQLITE_CALLBACK *xGeom)(sqlite3_rtree_geometry*, int, sqlite3_rtree_dbl*,int*), |
| 8402 | void *pContext |
| 8403 | ); |
| 8404 | |
| 8405 | |
| 8406 | /* |
| @@ -8396,25 +8410,25 @@ | |
| 8410 | struct sqlite3_rtree_geometry { |
| 8411 | void *pContext; /* Copy of pContext passed to s_r_g_c() */ |
| 8412 | int nParam; /* Size of array aParam[] */ |
| 8413 | sqlite3_rtree_dbl *aParam; /* Parameters passed to SQL geom function */ |
| 8414 | void *pUser; /* Callback implementation user data */ |
| 8415 | void (SQLITE_CALLBACK *xDelUser)(void *); /* Called by SQLite to clean up pUser */ |
| 8416 | }; |
| 8417 | |
| 8418 | /* |
| 8419 | ** Register a 2nd-generation geometry callback named zScore that can be |
| 8420 | ** used as part of an R-Tree geometry query as follows: |
| 8421 | ** |
| 8422 | ** SELECT ... FROM <rtree> WHERE <rtree col> MATCH $zQueryFunc(... params ...) |
| 8423 | */ |
| 8424 | SQLITE_API int SQLITE_APICALL sqlite3_rtree_query_callback( |
| 8425 | sqlite3 *db, |
| 8426 | const char *zQueryFunc, |
| 8427 | int (SQLITE_CALLBACK *xQueryFunc)(sqlite3_rtree_query_info*), |
| 8428 | void *pContext, |
| 8429 | void (SQLITE_CALLBACK *xDestructor)(void*) |
| 8430 | ); |
| 8431 | |
| 8432 | |
| 8433 | /* |
| 8434 | ** A pointer to a structure of the following type is passed as the |
| @@ -8428,11 +8442,11 @@ | |
| 8442 | struct sqlite3_rtree_query_info { |
| 8443 | void *pContext; /* pContext from when function registered */ |
| 8444 | int nParam; /* Number of function parameters */ |
| 8445 | sqlite3_rtree_dbl *aParam; /* value of function parameters */ |
| 8446 | void *pUser; /* callback can use this, if desired */ |
| 8447 | void (SQLITE_CALLBACK *xDelUser)(void*); /* function to free pUser */ |
| 8448 | sqlite3_rtree_dbl *aCoord; /* Coordinates of node or entry to check */ |
| 8449 | unsigned int *anQueue; /* Number of pending entries in the queue */ |
| 8450 | int nCoord; /* Number of coordinates */ |
| 8451 | int iLevel; /* Level of current node or entry */ |
| 8452 | int mxLevel; /* The largest iLevel value in the tree */ |
| @@ -8624,11 +8638,11 @@ | |
| 8638 | ** If xFilter returns 0, changes is not tracked. Note that once a table is |
| 8639 | ** attached, xFilter will not be called again. |
| 8640 | */ |
| 8641 | void sqlite3session_table_filter( |
| 8642 | sqlite3_session *pSession, /* Session object */ |
| 8643 | int(SQLITE_CALLBACK *xFilter)( |
| 8644 | void *pCtx, /* Copy of third arg to _filter_table() */ |
| 8645 | const char *zTab /* Table name */ |
| 8646 | ), |
| 8647 | void *pCtx /* First argument passed to xFilter */ |
| 8648 | ); |
| @@ -9199,11 +9213,11 @@ | |
| 9213 | ** An sqlite3_changegroup object is used to combine two or more changesets |
| 9214 | ** (or patchsets) into a single changeset (or patchset). A single changegroup |
| 9215 | ** object may combine changesets or patchsets, but not both. The output is |
| 9216 | ** always in the same format as the input. |
| 9217 | ** |
| 9218 | ** If successful, this function returns SQLITE_OK and populates (SQLITE_CALLBACK *pp) with |
| 9219 | ** a pointer to a new sqlite3_changegroup object before returning. The caller |
| 9220 | ** should eventually free the returned object using a call to |
| 9221 | ** sqlite3changegroup_delete(). If an error occurs, an SQLite error code |
| 9222 | ** (i.e. SQLITE_NOMEM) is returned and *pp is set to NULL. |
| 9223 | ** |
| @@ -9319,11 +9333,11 @@ | |
| 9333 | ** changes for tables that do not appear in the first changeset, they are |
| 9334 | ** appended onto the end of the output changeset, again in the order in |
| 9335 | ** which they are first encountered. |
| 9336 | ** |
| 9337 | ** If an error occurs, an SQLite error code is returned and the output |
| 9338 | ** variables (SQLITE_CALLBACK *pnData) and (*ppData) are set to 0. Otherwise, SQLITE_OK |
| 9339 | ** is returned and the output variables are set to the size of and a |
| 9340 | ** pointer to the output buffer, respectively. In this case it is the |
| 9341 | ** responsibility of the caller to eventually free the buffer using a |
| 9342 | ** call to sqlite3_free(). |
| 9343 | */ |
| @@ -9476,15 +9490,15 @@ | |
| 9490 | */ |
| 9491 | int sqlite3changeset_apply( |
| 9492 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9493 | int nChangeset, /* Size of changeset in bytes */ |
| 9494 | void *pChangeset, /* Changeset blob */ |
| 9495 | int(SQLITE_CALLBACK *xFilter)( |
| 9496 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9497 | const char *zTab /* Table name */ |
| 9498 | ), |
| 9499 | int(SQLITE_CALLBACK *xConflict)( |
| 9500 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9501 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9502 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9503 | ), |
| 9504 | void *pCtx /* First argument passed to xConflict */ |
| @@ -9621,20 +9635,20 @@ | |
| 9635 | ** </pre> |
| 9636 | ** |
| 9637 | ** Is replaced by: |
| 9638 | ** |
| 9639 | ** <pre> |
| 9640 | ** int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9641 | ** void *pIn, |
| 9642 | ** </pre> |
| 9643 | ** |
| 9644 | ** Each time the xInput callback is invoked by the sessions module, the first |
| 9645 | ** argument passed is a copy of the supplied pIn context pointer. The second |
| 9646 | ** argument, pData, points to a buffer (SQLITE_CALLBACK *pnData) bytes in size. Assuming no |
| 9647 | ** error occurs the xInput method should copy up to (SQLITE_CALLBACK *pnData) bytes of data |
| 9648 | ** into the buffer and set (SQLITE_CALLBACK *pnData) to the actual number of bytes copied |
| 9649 | ** before returning SQLITE_OK. If the input is completely exhausted, (SQLITE_CALLBACK *pnData) |
| 9650 | ** should be set to zero to indicate this. Or, if an error occurs, an SQLite |
| 9651 | ** error code should be returned. In all cases, if an xInput callback returns |
| 9652 | ** an error, all processing is abandoned and the streaming API function |
| 9653 | ** returns a copy of the error code to the caller. |
| 9654 | ** |
| @@ -9655,11 +9669,11 @@ | |
| 9669 | ** </pre> |
| 9670 | ** |
| 9671 | ** Is replaced by: |
| 9672 | ** |
| 9673 | ** <pre> |
| 9674 | ** int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9675 | ** void *pOut |
| 9676 | ** </pre> |
| 9677 | ** |
| 9678 | ** The xOutput callback is invoked zero or more times to return data to |
| 9679 | ** the application. The first parameter passed to each call is a copy of the |
| @@ -9675,58 +9689,58 @@ | |
| 9689 | ** parameter set to a value less than or equal to zero. Other than this, |
| 9690 | ** no guarantees are made as to the size of the chunks of data returned. |
| 9691 | */ |
| 9692 | int sqlite3changeset_apply_strm( |
| 9693 | sqlite3 *db, /* Apply change to "main" db of this handle */ |
| 9694 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), /* Input function */ |
| 9695 | void *pIn, /* First arg for xInput */ |
| 9696 | int(SQLITE_CALLBACK *xFilter)( |
| 9697 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9698 | const char *zTab /* Table name */ |
| 9699 | ), |
| 9700 | int(SQLITE_CALLBACK *xConflict)( |
| 9701 | void *pCtx, /* Copy of sixth arg to _apply() */ |
| 9702 | int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */ |
| 9703 | sqlite3_changeset_iter *p /* Handle describing change and conflict */ |
| 9704 | ), |
| 9705 | void *pCtx /* First argument passed to xConflict */ |
| 9706 | ); |
| 9707 | int sqlite3changeset_concat_strm( |
| 9708 | int (SQLITE_CALLBACK *xInputA)(void *pIn, void *pData, int *pnData), |
| 9709 | void *pInA, |
| 9710 | int (SQLITE_CALLBACK *xInputB)(void *pIn, void *pData, int *pnData), |
| 9711 | void *pInB, |
| 9712 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9713 | void *pOut |
| 9714 | ); |
| 9715 | int sqlite3changeset_invert_strm( |
| 9716 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9717 | void *pIn, |
| 9718 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9719 | void *pOut |
| 9720 | ); |
| 9721 | int sqlite3changeset_start_strm( |
| 9722 | sqlite3_changeset_iter **pp, |
| 9723 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9724 | void *pIn |
| 9725 | ); |
| 9726 | int sqlite3session_changeset_strm( |
| 9727 | sqlite3_session *pSession, |
| 9728 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9729 | void *pOut |
| 9730 | ); |
| 9731 | int sqlite3session_patchset_strm( |
| 9732 | sqlite3_session *pSession, |
| 9733 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9734 | void *pOut |
| 9735 | ); |
| 9736 | int sqlite3changegroup_add_strm(sqlite3_changegroup*, |
| 9737 | int (SQLITE_CALLBACK *xInput)(void *pIn, void *pData, int *pnData), |
| 9738 | void *pIn |
| 9739 | ); |
| 9740 | int sqlite3changegroup_output_strm(sqlite3_changegroup*, |
| 9741 | int (SQLITE_CALLBACK *xOutput)(void *pOut, const void *pData, int nData), |
| 9742 | void *pOut |
| 9743 | ); |
| 9744 | |
| 9745 | |
| 9746 | /* |
| @@ -9777,11 +9791,11 @@ | |
| 9791 | |
| 9792 | typedef struct Fts5ExtensionApi Fts5ExtensionApi; |
| 9793 | typedef struct Fts5Context Fts5Context; |
| 9794 | typedef struct Fts5PhraseIter Fts5PhraseIter; |
| 9795 | |
| 9796 | typedef void (SQLITE_CALLBACK *fts5_extension_function)( |
| 9797 | const Fts5ExtensionApi *pApi, /* API offered by current FTS version */ |
| 9798 | Fts5Context *pFts, /* First arg to pass to pApi functions */ |
| 9799 | sqlite3_context *pCtx, /* Context for returning result/error */ |
| 9800 | int nVal, /* Number of values in apVal[] array */ |
| 9801 | sqlite3_value **apVal /* Array of trailing arguments */ |
| @@ -9828,15 +9842,15 @@ | |
| 9842 | ** This function may be quite inefficient if used with an FTS5 table |
| 9843 | ** created with the "columnsize=0" option. |
| 9844 | ** |
| 9845 | ** xColumnText: |
| 9846 | ** This function attempts to retrieve the text of column iCol of the |
| 9847 | ** current document. If successful, (SQLITE_CALLBACK *pz) is set to point to a buffer |
| 9848 | ** containing the text in utf-8 encoding, (SQLITE_CALLBACK *pn) is set to the size in bytes |
| 9849 | ** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, |
| 9850 | ** if an error occurs, an SQLite error code is returned and the final values |
| 9851 | ** of (SQLITE_CALLBACK *pz) and (*pn) are undefined. |
| 9852 | ** |
| 9853 | ** xPhraseCount: |
| 9854 | ** Returns the number of phrases in the current query expression. |
| 9855 | ** |
| 9856 | ** xPhraseSize: |
| @@ -9941,11 +9955,11 @@ | |
| 9955 | ** xRowCount(pFts5, pnRow) |
| 9956 | ** |
| 9957 | ** This function is used to retrieve the total number of rows in the table. |
| 9958 | ** In other words, the same value that would be returned by: |
| 9959 | ** |
| 9960 | ** SELECT count(SQLITE_CALLBACK *) FROM ftstable; |
| 9961 | ** |
| 9962 | ** xPhraseFirst() |
| 9963 | ** This function is used, along with type Fts5PhraseIter and the xPhraseNext |
| 9964 | ** method, to iterate through all instances of a single query phrase within |
| 9965 | ** the current row. This is the same information as is accessible via the |
| @@ -10008,43 +10022,43 @@ | |
| 10022 | ** See xPhraseFirstColumn above. |
| 10023 | */ |
| 10024 | struct Fts5ExtensionApi { |
| 10025 | int iVersion; /* Currently always set to 3 */ |
| 10026 | |
| 10027 | void *(SQLITE_CALLBACK *xUserData)(Fts5Context*); |
| 10028 | |
| 10029 | int (SQLITE_CALLBACK *xColumnCount)(Fts5Context*); |
| 10030 | int (SQLITE_CALLBACK *xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 10031 | int (SQLITE_CALLBACK *xColumnTotalSize)(Fts5Context*, int iCol, sqlite3_int64 *pnToken); |
| 10032 | |
| 10033 | int (SQLITE_CALLBACK *xTokenize)(Fts5Context*, |
| 10034 | const char *pText, int nText, /* Text to tokenize */ |
| 10035 | void *pCtx, /* Context passed to xToken() */ |
| 10036 | int (SQLITE_CALLBACK *xToken)(void*, int, const char*, int, int, int) /* Callback */ |
| 10037 | ); |
| 10038 | |
| 10039 | int (SQLITE_CALLBACK *xPhraseCount)(Fts5Context*); |
| 10040 | int (SQLITE_CALLBACK *xPhraseSize)(Fts5Context*, int iPhrase); |
| 10041 | |
| 10042 | int (SQLITE_CALLBACK *xInstCount)(Fts5Context*, int *pnInst); |
| 10043 | int (SQLITE_CALLBACK *xInst)(Fts5Context*, int iIdx, int *piPhrase, int *piCol, int *piOff); |
| 10044 | |
| 10045 | sqlite3_int64 (SQLITE_CALLBACK *xRowid)(Fts5Context*); |
| 10046 | int (SQLITE_CALLBACK *xColumnText)(Fts5Context*, int iCol, const char **pz, int *pn); |
| 10047 | int (SQLITE_CALLBACK *xColumnSize)(Fts5Context*, int iCol, int *pnToken); |
| 10048 | |
| 10049 | int (SQLITE_CALLBACK *xQueryPhrase)(Fts5Context*, int iPhrase, void *pUserData, |
| 10050 | int(SQLITE_CALLBACK *)(const Fts5ExtensionApi*,Fts5Context*,void*) |
| 10051 | ); |
| 10052 | int (SQLITE_CALLBACK *xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*)); |
| 10053 | void *(SQLITE_CALLBACK *xGetAuxdata)(Fts5Context*, int bClear); |
| 10054 | |
| 10055 | int (SQLITE_CALLBACK *xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*); |
| 10056 | void (SQLITE_CALLBACK *xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff); |
| 10057 | |
| 10058 | int (SQLITE_CALLBACK *xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*); |
| 10059 | void (SQLITE_CALLBACK *xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol); |
| 10060 | }; |
| 10061 | |
| 10062 | /* |
| 10063 | ** CUSTOM AUXILIARY FUNCTIONS |
| 10064 | *************************************************************************/ |
| @@ -10068,11 +10082,11 @@ | |
| 10082 | ** The second and third arguments are an array of nul-terminated strings |
| 10083 | ** containing the tokenizer arguments, if any, specified following the |
| 10084 | ** tokenizer name as part of the CREATE VIRTUAL TABLE statement used |
| 10085 | ** to create the FTS5 table. |
| 10086 | ** |
| 10087 | ** The final argument is an output variable. If successful, (SQLITE_CALLBACK *ppOut) |
| 10088 | ** should be set to point to the new tokenizer handle and SQLITE_OK |
| 10089 | ** returned. If an error occurs, some value other than SQLITE_OK should |
| 10090 | ** be returned. In this case, fts5 assumes that the final value of *ppOut |
| 10091 | ** is undefined. |
| 10092 | ** |
| @@ -10242,17 +10256,17 @@ | |
| 10256 | ** inefficient. |
| 10257 | */ |
| 10258 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| 10259 | typedef struct fts5_tokenizer fts5_tokenizer; |
| 10260 | struct fts5_tokenizer { |
| 10261 | int (SQLITE_CALLBACK *xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); |
| 10262 | void (SQLITE_CALLBACK *xDelete)(Fts5Tokenizer*); |
| 10263 | int (SQLITE_CALLBACK *xTokenize)(Fts5Tokenizer*, |
| 10264 | void *pCtx, |
| 10265 | int flags, /* Mask of FTS5_TOKENIZE_* flags */ |
| 10266 | const char *pText, int nText, |
| 10267 | int (SQLITE_CALLBACK *xToken)( |
| 10268 | void *pCtx, /* Copy of 2nd argument to xTokenize() */ |
| 10269 | int tflags, /* Mask of FTS5_TOKEN_* flags */ |
| 10270 | const char *pToken, /* Pointer to buffer containing token */ |
| 10271 | int nToken, /* Size of token in bytes */ |
| 10272 | int iStart, /* Byte offset of token within input text */ |
| @@ -10281,33 +10295,33 @@ | |
| 10295 | typedef struct fts5_api fts5_api; |
| 10296 | struct fts5_api { |
| 10297 | int iVersion; /* Currently always set to 2 */ |
| 10298 | |
| 10299 | /* Create a new tokenizer */ |
| 10300 | int (SQLITE_CALLBACK *xCreateTokenizer)( |
| 10301 | fts5_api *pApi, |
| 10302 | const char *zName, |
| 10303 | void *pContext, |
| 10304 | fts5_tokenizer *pTokenizer, |
| 10305 | void (SQLITE_CALLBACK *xDestroy)(void*) |
| 10306 | ); |
| 10307 | |
| 10308 | /* Find an existing tokenizer */ |
| 10309 | int (SQLITE_CALLBACK *xFindTokenizer)( |
| 10310 | fts5_api *pApi, |
| 10311 | const char *zName, |
| 10312 | void **ppContext, |
| 10313 | fts5_tokenizer *pTokenizer |
| 10314 | ); |
| 10315 | |
| 10316 | /* Create a new auxiliary function */ |
| 10317 | int (SQLITE_CALLBACK *xCreateFunction)( |
| 10318 | fts5_api *pApi, |
| 10319 | const char *zName, |
| 10320 | void *pContext, |
| 10321 | fts5_extension_function xFunction, |
| 10322 | void (SQLITE_CALLBACK *xDestroy)(void*) |
| 10323 | ); |
| 10324 | }; |
| 10325 | |
| 10326 | /* |
| 10327 | ** END OF REGISTRATION API |
| 10328 |