better-sqlite3-multiple-ciphers 13.0.4-beta.0 → 13.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,10 +30,10 @@
30
30
  #define SQLITE3MC_VERSION_H_
31
31
 
32
32
  #define SQLITE3MC_VERSION_MAJOR 2
33
- #define SQLITE3MC_VERSION_MINOR 4
33
+ #define SQLITE3MC_VERSION_MINOR 7
34
34
  #define SQLITE3MC_VERSION_RELEASE 0
35
35
  #define SQLITE3MC_VERSION_SUBRELEASE 0
36
- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.4.0"
36
+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.7.0"
37
37
 
38
38
  #endif /* SQLITE3MC_VERSION_H_ */
39
39
  /*** End of #include "sqlite3mc_version.h" ***/
@@ -192,12 +192,12 @@ extern "C" {
192
192
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
193
193
  ** [sqlite_version()] and [sqlite_source_id()].
194
194
  */
195
- #define SQLITE_VERSION "3.53.4"
196
- #define SQLITE_VERSION_NUMBER 3053004
197
- #define SQLITE_SOURCE_ID "2026-07-24 19:02:57 bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc"
198
- #define SQLITE_SCM_BRANCH "branch-3.53"
199
- #define SQLITE_SCM_TAGS "release version-3.53.4"
200
- #define SQLITE_SCM_DATETIME "2026-07-24T19:02:57.525Z"
195
+ #define SQLITE_VERSION "3.54.1"
196
+ #define SQLITE_VERSION_NUMBER 3054001
197
+ #define SQLITE_SOURCE_ID "2026-10-16 14:45:20 555e07ef33f69a0957d24d8e555b702464a131d6f1607f4c3c1e4551e8e6ca76"
198
+ #define SQLITE_SCM_BRANCH "branch-3.54"
199
+ #define SQLITE_SCM_TAGS "release version-3.54.1"
200
+ #define SQLITE_SCM_DATETIME "2026-10-16T14:45:20.546Z"
201
201
 
202
202
  /*
203
203
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -509,7 +509,7 @@ SQLITE_API int sqlite3_exec(
509
509
  #define SQLITE_FULL 13 /* Insertion failed because database is full */
510
510
  #define SQLITE_CANTOPEN 14 /* Unable to open the database file */
511
511
  #define SQLITE_PROTOCOL 15 /* Database lock protocol error */
512
- #define SQLITE_EMPTY 16 /* Internal use only */
512
+ #define SQLITE_EMPTY 16 /* No content */
513
513
  #define SQLITE_SCHEMA 17 /* The database schema changed */
514
514
  #define SQLITE_TOOBIG 18 /* String or BLOB exceeds size limit */
515
515
  #define SQLITE_CONSTRAINT 19 /* Abort due to constraint violation */
@@ -3006,8 +3006,9 @@ SQLITE_API int sqlite3_is_interrupted(sqlite3*);
3006
3006
  ** These routines are useful during command-line input to determine if the
3007
3007
  ** currently entered text seems to form a complete SQL statement or
3008
3008
  ** if additional input is needed before sending the text into
3009
- ** SQLite for parsing. ^These routines return 1 if the input string
3010
- ** appears to be a complete SQL statement. ^A statement is judged to be
3009
+ ** SQLite for parsing. ^The sqlite3_complete(X) and sqlite3_complete16(X)
3010
+ ** routines return 1 if the input string X appears to be a complete SQL
3011
+ ** statement. ^A statement is judged to be
3011
3012
  ** complete if it ends with a semicolon token and is not a prefix of a
3012
3013
  ** well-formed CREATE TRIGGER statement. ^Semicolons that are embedded within
3013
3014
  ** string literals or quoted identifier names or comments are not
@@ -3015,11 +3016,25 @@ SQLITE_API int sqlite3_is_interrupted(sqlite3*);
3015
3016
  ** embedded) and thus do not count as a statement terminator. ^Whitespace
3016
3017
  ** and comments that follow the final semicolon are ignored.
3017
3018
  **
3018
- ** ^These routines return 0 if the statement is incomplete. ^If a
3019
- ** memory allocation fails, then SQLITE_NOMEM is returned.
3020
- **
3021
- ** ^These routines do not parse the SQL statements and thus
3022
- ** will not detect syntactically incorrect SQL.
3019
+ ** ^The sqlite3_complete(X) and sqlite3_complete16(X) routines return 0
3020
+ ** if the statement is incomplete. ^If a memory allocation fails, then
3021
+ ** SQLITE_NOMEM is returned.
3022
+ **
3023
+ ** The [sqlite3_incomplete(X)] routine is similar to [sqlite3_complete(X)]
3024
+ ** except that sqlite3_incomplete(X) returns SQLITE_OK if the input X is
3025
+ ** complete, SQLITE_EMPTY if input X consists entirely of whitespace and/or
3026
+ ** comments, SQLITE_MISUSE if X is a NULL pointer, and some other non-zero
3027
+ ** value if X is incomplete. The non-zero return from
3028
+ ** sqlite3_incomplete(X) contains additional information about what is
3029
+ ** needed to complete the input X. See the header comment on the
3030
+ ** implemenation of the sqlite3_incomplete() routine for a full description
3031
+ ** of its non-zero return values. The sqlite3_incomplete(X) interface
3032
+ ** is only available for UTF-8 text.
3033
+ **
3034
+ ** ^None of these routines do a full parse the SQL statements and thus
3035
+ ** will not detect syntactically incorrect SQL. They only determine if
3036
+ ** input text has properly terminated comments, string literals, and
3037
+ ** quoted identifiers, and if the statement ends with a semicolon.
3023
3038
  **
3024
3039
  ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
3025
3040
  ** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked
@@ -3027,14 +3042,15 @@ SQLITE_API int sqlite3_is_interrupted(sqlite3*);
3027
3042
  ** then the return value from sqlite3_complete16() will be non-zero
3028
3043
  ** regardless of whether or not the input SQL is complete.)^
3029
3044
  **
3030
- ** The input to [sqlite3_complete()] must be a zero-terminated
3031
- ** UTF-8 string.
3045
+ ** The X input to [sqlite3_complete(X)] and [sqlite3_incomplete(X)]
3046
+ ** must be a zero-terminated UTF-8 string.
3032
3047
  **
3033
3048
  ** The input to [sqlite3_complete16()] must be a zero-terminated
3034
3049
  ** UTF-16 string in native byte order.
3035
3050
  */
3036
3051
  SQLITE_API int sqlite3_complete(const char *sql);
3037
3052
  SQLITE_API int sqlite3_complete16(const void *sql);
3053
+ SQLITE_API sqlite3_int64 sqlite3_incomplete(const char *sql);
3038
3054
 
3039
3055
  /*
3040
3056
  ** CAPI3REF: Register A Callback To Handle SQLITE_BUSY Errors
@@ -3447,7 +3463,7 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
3447
3463
  **
3448
3464
  ** ^The first parameter to the authorizer callback is a copy of the third
3449
3465
  ** parameter to the sqlite3_set_authorizer() interface. ^The second parameter
3450
- ** to the callback is an integer [SQLITE_COPY | action code] that specifies
3466
+ ** to the callback is an integer [SQLITE_READ | action code] that specifies
3451
3467
  ** the particular action to be authorized. ^The third through sixth parameters
3452
3468
  ** to the callback are either NULL pointers or zero-terminated strings
3453
3469
  ** that contain additional details about the action to be authorized.
@@ -3490,21 +3506,33 @@ SQLITE_API void sqlite3_randomness(int N, void *P);
3490
3506
  ** previous call.)^ ^Disable the authorizer by installing a NULL callback.
3491
3507
  ** The authorizer is disabled by default.
3492
3508
  **
3493
- ** The authorizer callback must not do anything that will modify
3509
+ ** <h3>Limitations And Caveats</h3><ul>
3510
+ **
3511
+ ** <li>The authorizer callback must not do anything that will modify
3494
3512
  ** the database connection that invoked the authorizer callback.
3495
3513
  ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3496
3514
  ** database connections for the meaning of "modify" in this paragraph.
3497
3515
  **
3498
- ** ^When [sqlite3_prepare_v2()] is used to prepare a statement, the
3516
+ ** <li>^When [sqlite3_prepare_v2()] is used to prepare a statement, the
3499
3517
  ** statement might be re-prepared during [sqlite3_step()] due to a
3500
3518
  ** schema change. Hence, the application should ensure that the
3501
3519
  ** correct authorizer callback remains in place during the [sqlite3_step()].
3502
3520
  **
3503
- ** ^Note that the authorizer callback is invoked only during
3521
+ ** <li>^The authorizer callback is invoked only during
3504
3522
  ** [sqlite3_prepare()] or its variants. Authorization is not
3505
3523
  ** performed during statement evaluation in [sqlite3_step()], unless
3506
3524
  ** as stated in the previous paragraph, sqlite3_step() invokes
3507
3525
  ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
3526
+ **
3527
+ ** <li>Authorizer callbacks for the expressions of a
3528
+ ** [generated column] are invoked when the schema is parsed (and specifically
3529
+ ** when the [CREATE TABLE] statement that contains the generated column is
3530
+ ** parsed) not when the generated column is used in a DML statement.
3531
+ ** This is deliberate, as one of the purposes of generated columns
3532
+ ** is to give schema designers the ability to provide gated access
3533
+ ** to privileged columns and/or functions.
3534
+ **
3535
+ ** </ul>
3508
3536
  */
3509
3537
  SQLITE_API int sqlite3_set_authorizer(
3510
3538
  sqlite3*,
@@ -3545,6 +3573,11 @@ SQLITE_API int sqlite3_set_authorizer(
3545
3573
  ** is the name of the inner-most trigger or view that is responsible for
3546
3574
  ** the access attempt or NULL if this access attempt is directly from
3547
3575
  ** top-level SQL code.
3576
+ **
3577
+ ** The case of strings in the 3rd through the 6th argument to the
3578
+ ** authorization callback is arbitrary. Authorization callbacks
3579
+ ** implementations should use [sqlite3_stricmp()] or similar when
3580
+ ** doing comparisons against those values.
3548
3581
  */
3549
3582
  /******************************************* 3rd ************ 4th ***********/
3550
3583
  #define SQLITE_CREATE_INDEX 1 /* Index Name Table Name */
@@ -3579,9 +3612,14 @@ SQLITE_API int sqlite3_set_authorizer(
3579
3612
  #define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */
3580
3613
  #define SQLITE_FUNCTION 31 /* NULL Function Name */
3581
3614
  #define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */
3582
- #define SQLITE_COPY 0 /* No longer used */
3583
3615
  #define SQLITE_RECURSIVE 33 /* NULL NULL */
3584
3616
 
3617
+ /*
3618
+ ** Note: The SQLITE_COPY macro (with value 0) used to be one of the
3619
+ ** action codes above. That macro has now been repurposed as a possible
3620
+ ** value to the 3rd argument to sqlite3_result_str().
3621
+ */
3622
+
3585
3623
  /*
3586
3624
  ** CAPI3REF: Deprecated Tracing And Profiling Functions
3587
3625
  ** DEPRECATED
@@ -4088,8 +4126,7 @@ SQLITE_API int sqlite3_open_v2(
4088
4126
  **
4089
4127
  ** The sqlite3_uri_int64(F,P,D) routine converts the value of P into a
4090
4128
  ** 64-bit signed integer and returns that integer, or D if P does not
4091
- ** exist. If the value of P is something other than an integer, then
4092
- ** zero is returned.
4129
+ ** exist or if the value of P is something other than an integer.
4093
4130
  **
4094
4131
  ** The sqlite3_uri_key(F,N) returns a pointer to the name (not
4095
4132
  ** the value) of the N-th query parameter for filename F, or a NULL
@@ -4450,6 +4487,14 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
4450
4487
  ** [[SQLITE_LIMIT_WORKER_THREADS]] ^(<dt>SQLITE_LIMIT_WORKER_THREADS</dt>
4451
4488
  ** <dd>The maximum number of auxiliary worker threads that a single
4452
4489
  ** [prepared statement] may start.</dd>)^
4490
+ **
4491
+ ** [[SQLITE_LIMIT_SCHEMA]] ^(<dt>SQLITE_LIMIT_SCHEMA</dt>
4492
+ ** <dd>The maximum number of objects (tables, indexes, triggers, and views)
4493
+ ** defined by the database schema.</dd>)^
4494
+ **
4495
+ ** [[SQLITE_LIMIT_TRIGGER_STEPS]] ^(<dt>SQLITE_LIMIT_TRIGGER_STEPS</dt>
4496
+ ** <dd>The maximum number of SQL statements that can be contained within
4497
+ ** a single trigger.</dd>)^
4453
4498
  ** </dl>
4454
4499
  */
4455
4500
  #define SQLITE_LIMIT_LENGTH 0
@@ -4465,6 +4510,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
4465
4510
  #define SQLITE_LIMIT_TRIGGER_DEPTH 10
4466
4511
  #define SQLITE_LIMIT_WORKER_THREADS 11
4467
4512
  #define SQLITE_LIMIT_PARSER_DEPTH 12
4513
+ #define SQLITE_LIMIT_SCHEMA 13
4514
+ #define SQLITE_LIMIT_TRIGGER_STEPS 14
4468
4515
 
4469
4516
  /*
4470
4517
  ** CAPI3REF: Prepare Flags
@@ -4576,6 +4623,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
4576
4623
  ** the nul-terminator.
4577
4624
  ** Note that nByte measures the length of the input in bytes, not
4578
4625
  ** characters, even for the UTF-16 interfaces.
4626
+ ** For the sqlite3_prepare16() and sqlite3_prepare16_v2() interfaces,
4627
+ ** the nByte value must be even or undefined behavior can result.
4579
4628
  **
4580
4629
  ** ^If pzTail is not NULL then *pzTail is made to point to the first byte
4581
4630
  ** past the end of the first SQL statement in zSql. These routines only
@@ -5322,7 +5371,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
5322
5371
  ** [prepared statement]. ^In the "v2" interface,
5323
5372
  ** the more specific error code is returned directly by sqlite3_step().
5324
5373
  **
5325
- ** [SQLITE_MISUSE] means that the this routine was called inappropriately.
5374
+ ** [SQLITE_MISUSE] means that this routine was called inappropriately.
5326
5375
  ** Perhaps it was called on a [prepared statement] that has
5327
5376
  ** already been [sqlite3_finalize | finalized] or on one that had
5328
5377
  ** previously returned [SQLITE_ERROR] or [SQLITE_DONE]. Or it could
@@ -6495,7 +6544,11 @@ typedef void (*sqlite3_destructor_type)(void*);
6495
6544
  **
6496
6545
  ** ^The sqlite3_result_zeroblob(C,N) and sqlite3_result_zeroblob64(C,N)
6497
6546
  ** interfaces set the result of the application-defined function to be
6498
- ** a BLOB containing all zero bytes and N bytes in size.
6547
+ ** a BLOB containing all zero bytes and N bytes in size. The
6548
+ ** zeroblob64(C,N) interface returns a [result code], which is normally
6549
+ ** [SQLITE_OK] but might be some other value if the requested operation
6550
+ ** could not be complete, for example if insufficient memory is available
6551
+ ** or if the value of N is out of range.
6499
6552
  **
6500
6553
  ** ^The sqlite3_result_double() interface sets the result from
6501
6554
  ** an application-defined function to be a floating point value specified
@@ -8833,8 +8886,8 @@ SQLITE_API int sqlite3_keyword_check(const char*,int);
8833
8886
  ** <li> ^The sqlite3_str object is created using [sqlite3_str_new()].
8834
8887
  ** <li> ^Text is appended to the sqlite3_str object using various
8835
8888
  ** methods, such as [sqlite3_str_appendf()].
8836
- ** <li> ^The sqlite3_str object is destroyed and the string it created
8837
- ** is returned using the [sqlite3_str_finish()] interface.
8889
+ ** <li> The sqlite3_str object is destroyed and the string it created
8890
+ ** is returned using [sqlite3_str_finish()] or [sqlite3_result_str()].
8838
8891
  ** </ol>
8839
8892
  */
8840
8893
  typedef struct sqlite3_str sqlite3_str;
@@ -8886,6 +8939,40 @@ SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*);
8886
8939
  SQLITE_API char *sqlite3_str_finish(sqlite3_str*);
8887
8940
  SQLITE_API void sqlite3_str_free(sqlite3_str*);
8888
8941
 
8942
+ /*
8943
+ ** CAPI3REF: Return A Dynamic String From an SQL Function
8944
+ **
8945
+ ** The [sqlite3_result_str(C,S,F)] interface causes the
8946
+ ** [sqlite3_str|dynamic string] S to become the return value for the
8947
+ ** application-defined function or virtual table that uses
8948
+ ** [sqlite3_context] C. The F flag can be one of [SQLITE_COPY]
8949
+ ** or [SQLITE_XFER] or [SQLITE_FINISH].
8950
+ **
8951
+ ** If the dynamic string is invalid or incomplete due to an out-of-memory
8952
+ ** or string-too-large error, then this routine transfers that error
8953
+ ** over to the SQL function.
8954
+ **
8955
+ ** If the F argument is SQLITE_COPY, then a copy of the dynamic string
8956
+ ** content is made and the dynamic string object is unchanged.
8957
+ ** If the F argument is SQLITE_XFER, then ownership of the content
8958
+ ** in the dynamic is transferred to the SQL function (via a pointer copy
8959
+ ** rather than a string copy) and the dynamic string is reset to an
8960
+ ** empty string. The SQLITE_FINISH value for F works like SQLITE_RESET
8961
+ ** except that it also invokes the [sqlite3_str_free(S)] destructor
8962
+ ** on the dynamic string object.
8963
+ */
8964
+ SQLITE_API void sqlite3_result_str(sqlite3_context*, sqlite3_str*, int);
8965
+
8966
+ /*
8967
+ ** CAPI3REF: Control Flags For sqlite3_result_str()
8968
+ **
8969
+ ** The following integers can be used as the third "F" argument
8970
+ ** to [sqlite3_result_str(C,S,F)].
8971
+ */
8972
+ #define SQLITE_COPY 0 /* Results copied. Dynamic string unchanged */
8973
+ #define SQLITE_XFER 1 /* Results transfered. Dynamic string reset */
8974
+ #define SQLITE_FINISH 2 /* Like SQLITE_XFER, plus dynamic string freed */
8975
+
8889
8976
  /*
8890
8977
  ** CAPI3REF: Add Content To A Dynamic String
8891
8978
  ** METHOD: sqlite3_str
@@ -11251,8 +11338,19 @@ SQLITE_API unsigned char *sqlite3_serialize(
11251
11338
  ** used. The serialized database P is N bytes in size. M is the size
11252
11339
  ** of the buffer P, which might be larger than N. If M is larger than
11253
11340
  ** N, and the SQLITE_DESERIALIZE_READONLY bit is not set in F, then
11254
- ** SQLite is permitted to add content to the in-memory database as
11255
- ** long as the total size does not exceed M bytes.
11341
+ ** SQLite is permitted to add content to the in-memory database, in
11342
+ ** page-sized chunks, as long as the total size does not exceed M bytes.
11343
+ **
11344
+ ** The parameter M must be greater than or equal to N. Ideally, M
11345
+ ** should have a value which is N+(512&times;K)+20 where K determines how
11346
+ ** must extra space is available to hold new content as the database
11347
+ ** grows. K can be 0 if the database is read-only.
11348
+ **
11349
+ ** If the database content in P is malformed in a malicious way then
11350
+ ** it is possible that SQLite might try to read a few more than N bytes
11351
+ ** from P. If the veracity of the database content P is uncertain,
11352
+ ** then applications are advised to allocate about 20 extra bytes on
11353
+ ** the end of the P buffer to avoid a memory error.
11256
11354
  **
11257
11355
  ** If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will
11258
11356
  ** invoke sqlite3_free() on the serialization buffer when the database
@@ -14544,7 +14642,7 @@ typedef int (*GetLegacy_t)(void* cipher);
14544
14642
  typedef int (*GetPageSize_t)(void* cipher);
14545
14643
  typedef int (*GetReserved_t)(void* cipher);
14546
14644
  typedef unsigned char* (*GetSalt_t)(void* cipher);
14547
- typedef void (*GenerateKey_t)(void* cipher, char* userPassword, int passwordLength, int rekey, unsigned char* cipherSalt);
14645
+ typedef int (*GenerateKey_t)(void* cipher, char* userPassword, int passwordLength, int rekey, unsigned char* cipherSalt);
14548
14646
  typedef int (*EncryptPage_t)(void* cipher, int page, unsigned char* data, int len, int reserved);
14549
14647
  typedef int (*DecryptPage_t)(void* cipher, int page, unsigned char* data, int len, int reserved, int hmacCheck);
14550
14648
 
@@ -14619,4 +14717,936 @@ SQLITE_API void sqlite3mc_vfs_shutdown();
14619
14717
  /*** End of #include "sqlite3mc_vfs.h" ***/
14620
14718
 
14621
14719
 
14720
+ /*
14721
+ ** Dispatch table support
14722
+ */
14723
+
14724
+ #ifdef SQLITE3MC_USE_DISPATCH_TABLE
14725
+
14726
+ /*
14727
+ ** Instead of making the SQLite symbols public dispatch tables can be
14728
+ ** used. In that case only the pointers to the dispatch tables are
14729
+ ** made public, hiding all other SQLite symbols. This is useful for
14730
+ ** modules which want to use an embedded SQLite version without
14731
+ ** conflicts with other SQLite implementation.
14732
+ **
14733
+ ** The only rule to obey is that such an embedded SQLite instance
14734
+ ** should not access the same database files as a separate SQLite
14735
+ ** instance within the same process, because that could lead to
14736
+ ** database corruption.
14737
+ **
14738
+ ** Define symbol SQLITE3MC_USE_DISPATCH_TABLE to activate the use of
14739
+ ** dispatch tables.
14740
+ **
14741
+ ** Define symbol SQLITE3MC_API_TABLE_PREFIX to specify your own
14742
+ ** global symbols for the dispatch tables to avoid name clashes.
14743
+ **
14744
+ ** Example: #define SQLITE3MC_API_TABLE_PREFIX MyApplication
14745
+ **
14746
+ ** The default prefix is "sqlite3mc".
14747
+ */
14748
+
14749
+ #ifndef SQLITE3MC_API_TABLE_PREFIX
14750
+ #define SQLITE3MC_API_TABLE_PREFIX sqlite3mc
14751
+ #endif
14752
+
14753
+ #define SQLITE3MC_CONCAT(A,B) SQLITE3MC_CONCAT_(A,B)
14754
+ #define SQLITE3MC_CONCAT_(A,B) A##B
14755
+ #define SQLITE3MC_API_TABLE(name) SQLITE3MC_CONCAT(SQLITE3MC_API_TABLE_PREFIX,SQLITE3MC_CONCAT(_,name))
14756
+
14757
+ #define SQLITE3MC_API_TABLE_EXT SQLITE3MC_API_TABLE(api_ext)
14758
+ #define SQLITE3MC_API_TABLE_CORE SQLITE3MC_API_TABLE(api_core)
14759
+ #define SQLITE3MC_API_TABLE_MC SQLITE3MC_API_TABLE(api_mc)
14760
+
14761
+ /* Define the dispatch table name for sqlite3ext.h */
14762
+ #define sqlite3_api SQLITE3MC_API_TABLE_EXT
14763
+
14764
+ /* #include "sqlite3ext.h" */
14765
+ /*** Begin of #include "sqlite3ext.h" ***/
14766
+ /*
14767
+ ** 2006 June 7
14768
+ **
14769
+ ** The author disclaims copyright to this source code. In place of
14770
+ ** a legal notice, here is a blessing:
14771
+ **
14772
+ ** May you do good and not evil.
14773
+ ** May you find forgiveness for yourself and forgive others.
14774
+ ** May you share freely, never taking more than you give.
14775
+ **
14776
+ *************************************************************************
14777
+ ** This header file defines the SQLite interface for use by
14778
+ ** shared libraries that want to be imported as extensions into
14779
+ ** an SQLite instance. Shared libraries that intend to be loaded
14780
+ ** as extensions by SQLite should #include this file instead of
14781
+ ** sqlite3.h.
14782
+ */
14783
+ #ifndef SQLITE3EXT_H
14784
+ #define SQLITE3EXT_H
14785
+ /* #include "sqlite3.h" */
14786
+
14787
+
14788
+ /*
14789
+ ** The following structure holds pointers to all of the SQLite API
14790
+ ** routines.
14791
+ **
14792
+ ** WARNING: In order to maintain backwards compatibility, add new
14793
+ ** interfaces to the end of this structure only. If you insert new
14794
+ ** interfaces in the middle of this structure, then older different
14795
+ ** versions of SQLite will not be able to load each other's shared
14796
+ ** libraries!
14797
+ */
14798
+ struct sqlite3_api_routines {
14799
+ void * (*aggregate_context)(sqlite3_context*,int nBytes);
14800
+ int (*aggregate_count)(sqlite3_context*);
14801
+ int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*));
14802
+ int (*bind_double)(sqlite3_stmt*,int,double);
14803
+ int (*bind_int)(sqlite3_stmt*,int,int);
14804
+ int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64);
14805
+ int (*bind_null)(sqlite3_stmt*,int);
14806
+ int (*bind_parameter_count)(sqlite3_stmt*);
14807
+ int (*bind_parameter_index)(sqlite3_stmt*,const char*zName);
14808
+ const char * (*bind_parameter_name)(sqlite3_stmt*,int);
14809
+ int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*));
14810
+ int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*));
14811
+ int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*);
14812
+ int (*busy_handler)(sqlite3*,int(*)(void*,int),void*);
14813
+ int (*busy_timeout)(sqlite3*,int ms);
14814
+ int (*changes)(sqlite3*);
14815
+ int (*close)(sqlite3*);
14816
+ int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*,
14817
+ int eTextRep,const char*));
14818
+ int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*,
14819
+ int eTextRep,const void*));
14820
+ const void * (*column_blob)(sqlite3_stmt*,int iCol);
14821
+ int (*column_bytes)(sqlite3_stmt*,int iCol);
14822
+ int (*column_bytes16)(sqlite3_stmt*,int iCol);
14823
+ int (*column_count)(sqlite3_stmt*pStmt);
14824
+ const char * (*column_database_name)(sqlite3_stmt*,int);
14825
+ const void * (*column_database_name16)(sqlite3_stmt*,int);
14826
+ const char * (*column_decltype)(sqlite3_stmt*,int i);
14827
+ const void * (*column_decltype16)(sqlite3_stmt*,int);
14828
+ double (*column_double)(sqlite3_stmt*,int iCol);
14829
+ int (*column_int)(sqlite3_stmt*,int iCol);
14830
+ sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol);
14831
+ const char * (*column_name)(sqlite3_stmt*,int);
14832
+ const void * (*column_name16)(sqlite3_stmt*,int);
14833
+ const char * (*column_origin_name)(sqlite3_stmt*,int);
14834
+ const void * (*column_origin_name16)(sqlite3_stmt*,int);
14835
+ const char * (*column_table_name)(sqlite3_stmt*,int);
14836
+ const void * (*column_table_name16)(sqlite3_stmt*,int);
14837
+ const unsigned char * (*column_text)(sqlite3_stmt*,int iCol);
14838
+ const void * (*column_text16)(sqlite3_stmt*,int iCol);
14839
+ int (*column_type)(sqlite3_stmt*,int iCol);
14840
+ sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol);
14841
+ void * (*commit_hook)(sqlite3*,int(*)(void*),void*);
14842
+ int (*complete)(const char*sql);
14843
+ int (*complete16)(const void*sql);
14844
+ int (*create_collation)(sqlite3*,const char*,int,void*,
14845
+ int(*)(void*,int,const void*,int,const void*));
14846
+ int (*create_collation16)(sqlite3*,const void*,int,void*,
14847
+ int(*)(void*,int,const void*,int,const void*));
14848
+ int (*create_function)(sqlite3*,const char*,int,int,void*,
14849
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
14850
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
14851
+ void (*xFinal)(sqlite3_context*));
14852
+ int (*create_function16)(sqlite3*,const void*,int,int,void*,
14853
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
14854
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
14855
+ void (*xFinal)(sqlite3_context*));
14856
+ int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*);
14857
+ int (*data_count)(sqlite3_stmt*pStmt);
14858
+ sqlite3 * (*db_handle)(sqlite3_stmt*);
14859
+ int (*declare_vtab)(sqlite3*,const char*);
14860
+ int (*enable_shared_cache)(int);
14861
+ int (*errcode)(sqlite3*db);
14862
+ const char * (*errmsg)(sqlite3*);
14863
+ const void * (*errmsg16)(sqlite3*);
14864
+ int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**);
14865
+ int (*expired)(sqlite3_stmt*);
14866
+ int (*finalize)(sqlite3_stmt*pStmt);
14867
+ void (*free)(void*);
14868
+ void (*free_table)(char**result);
14869
+ int (*get_autocommit)(sqlite3*);
14870
+ void * (*get_auxdata)(sqlite3_context*,int);
14871
+ int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**);
14872
+ int (*global_recover)(void);
14873
+ void (*interruptx)(sqlite3*);
14874
+ sqlite_int64 (*last_insert_rowid)(sqlite3*);
14875
+ const char * (*libversion)(void);
14876
+ int (*libversion_number)(void);
14877
+ void *(*malloc)(int);
14878
+ char *(SQLITE_CDECL*mprintf)(const char*,...);
14879
+ int (*open)(const char*,sqlite3**);
14880
+ int (*open16)(const void*,sqlite3**);
14881
+ int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
14882
+ int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
14883
+ void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*);
14884
+ void (*progress_handler)(sqlite3*,int,int(*)(void*),void*);
14885
+ void *(*realloc)(void*,int);
14886
+ int (*reset)(sqlite3_stmt*pStmt);
14887
+ void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*));
14888
+ void (*result_double)(sqlite3_context*,double);
14889
+ void (*result_error)(sqlite3_context*,const char*,int);
14890
+ void (*result_error16)(sqlite3_context*,const void*,int);
14891
+ void (*result_int)(sqlite3_context*,int);
14892
+ void (*result_int64)(sqlite3_context*,sqlite_int64);
14893
+ void (*result_null)(sqlite3_context*);
14894
+ void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*));
14895
+ void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*));
14896
+ void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*));
14897
+ void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*));
14898
+ void (*result_value)(sqlite3_context*,sqlite3_value*);
14899
+ void *(*rollback_hook)(sqlite3*,void(*)(void*),void*);
14900
+ int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*,
14901
+ const char*,const char*),void*);
14902
+ void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*));
14903
+ char *(SQLITE_CDECL*xsnprintf)(int,char*,const char*,...);
14904
+ int (*step)(sqlite3_stmt*);
14905
+ int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*,
14906
+ char const**,char const**,int*,int*,int*);
14907
+ void (*thread_cleanup)(void);
14908
+ int (*total_changes)(sqlite3*);
14909
+ void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*);
14910
+ int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*);
14911
+ void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*,
14912
+ sqlite_int64),void*);
14913
+ void * (*user_data)(sqlite3_context*);
14914
+ const void * (*value_blob)(sqlite3_value*);
14915
+ int (*value_bytes)(sqlite3_value*);
14916
+ int (*value_bytes16)(sqlite3_value*);
14917
+ double (*value_double)(sqlite3_value*);
14918
+ int (*value_int)(sqlite3_value*);
14919
+ sqlite_int64 (*value_int64)(sqlite3_value*);
14920
+ int (*value_numeric_type)(sqlite3_value*);
14921
+ const unsigned char * (*value_text)(sqlite3_value*);
14922
+ const void * (*value_text16)(sqlite3_value*);
14923
+ const void * (*value_text16be)(sqlite3_value*);
14924
+ const void * (*value_text16le)(sqlite3_value*);
14925
+ int (*value_type)(sqlite3_value*);
14926
+ char *(*vmprintf)(const char*,va_list);
14927
+ /* Added ??? */
14928
+ int (*overload_function)(sqlite3*, const char *zFuncName, int nArg);
14929
+ /* Added by 3.3.13 */
14930
+ int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**);
14931
+ int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**);
14932
+ int (*clear_bindings)(sqlite3_stmt*);
14933
+ /* Added by 3.4.1 */
14934
+ int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*,
14935
+ void (*xDestroy)(void *));
14936
+ /* Added by 3.5.0 */
14937
+ int (*bind_zeroblob)(sqlite3_stmt*,int,int);
14938
+ int (*blob_bytes)(sqlite3_blob*);
14939
+ int (*blob_close)(sqlite3_blob*);
14940
+ int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64,
14941
+ int,sqlite3_blob**);
14942
+ int (*blob_read)(sqlite3_blob*,void*,int,int);
14943
+ int (*blob_write)(sqlite3_blob*,const void*,int,int);
14944
+ int (*create_collation_v2)(sqlite3*,const char*,int,void*,
14945
+ int(*)(void*,int,const void*,int,const void*),
14946
+ void(*)(void*));
14947
+ int (*file_control)(sqlite3*,const char*,int,void*);
14948
+ sqlite3_int64 (*memory_highwater)(int);
14949
+ sqlite3_int64 (*memory_used)(void);
14950
+ sqlite3_mutex *(*mutex_alloc)(int);
14951
+ void (*mutex_enter)(sqlite3_mutex*);
14952
+ void (*mutex_free)(sqlite3_mutex*);
14953
+ void (*mutex_leave)(sqlite3_mutex*);
14954
+ int (*mutex_try)(sqlite3_mutex*);
14955
+ int (*open_v2)(const char*,sqlite3**,int,const char*);
14956
+ int (*release_memory)(int);
14957
+ void (*result_error_nomem)(sqlite3_context*);
14958
+ void (*result_error_toobig)(sqlite3_context*);
14959
+ int (*sleep)(int);
14960
+ void (*soft_heap_limit)(int);
14961
+ sqlite3_vfs *(*vfs_find)(const char*);
14962
+ int (*vfs_register)(sqlite3_vfs*,int);
14963
+ int (*vfs_unregister)(sqlite3_vfs*);
14964
+ int (*xthreadsafe)(void);
14965
+ void (*result_zeroblob)(sqlite3_context*,int);
14966
+ void (*result_error_code)(sqlite3_context*,int);
14967
+ int (SQLITE_CDECL*test_control)(int, ...);
14968
+ void (*randomness)(int,void*);
14969
+ sqlite3 *(*context_db_handle)(sqlite3_context*);
14970
+ int (*extended_result_codes)(sqlite3*,int);
14971
+ int (*limit)(sqlite3*,int,int);
14972
+ sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*);
14973
+ const char *(*sql)(sqlite3_stmt*);
14974
+ int (*status)(int,int*,int*,int);
14975
+ int (*backup_finish)(sqlite3_backup*);
14976
+ sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*);
14977
+ int (*backup_pagecount)(sqlite3_backup*);
14978
+ int (*backup_remaining)(sqlite3_backup*);
14979
+ int (*backup_step)(sqlite3_backup*,int);
14980
+ const char *(*compileoption_get)(int);
14981
+ int (*compileoption_used)(const char*);
14982
+ int (*create_function_v2)(sqlite3*,const char*,int,int,void*,
14983
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
14984
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
14985
+ void (*xFinal)(sqlite3_context*),
14986
+ void(*xDestroy)(void*));
14987
+ int (SQLITE_CDECL*db_config)(sqlite3*,int,...);
14988
+ sqlite3_mutex *(*db_mutex)(sqlite3*);
14989
+ int (*db_status)(sqlite3*,int,int*,int*,int);
14990
+ int (*extended_errcode)(sqlite3*);
14991
+ void (SQLITE_CDECL*log)(int,const char*,...);
14992
+ sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64);
14993
+ const char *(*sourceid)(void);
14994
+ int (*stmt_status)(sqlite3_stmt*,int,int);
14995
+ int (*strnicmp)(const char*,const char*,int);
14996
+ int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*);
14997
+ int (*wal_autocheckpoint)(sqlite3*,int);
14998
+ int (*wal_checkpoint)(sqlite3*,const char*);
14999
+ void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*);
15000
+ int (*blob_reopen)(sqlite3_blob*,sqlite3_int64);
15001
+ int (SQLITE_CDECL*vtab_config)(sqlite3*,int op,...);
15002
+ int (*vtab_on_conflict)(sqlite3*);
15003
+ /* Version 3.7.16 and later */
15004
+ int (*close_v2)(sqlite3*);
15005
+ const char *(*db_filename)(sqlite3*,const char*);
15006
+ int (*db_readonly)(sqlite3*,const char*);
15007
+ int (*db_release_memory)(sqlite3*);
15008
+ const char *(*errstr)(int);
15009
+ int (*stmt_busy)(sqlite3_stmt*);
15010
+ int (*stmt_readonly)(sqlite3_stmt*);
15011
+ int (*stricmp)(const char*,const char*);
15012
+ int (*uri_boolean)(const char*,const char*,int);
15013
+ sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64);
15014
+ const char *(*uri_parameter)(const char*,const char*);
15015
+ char *(*xvsnprintf)(int,char*,const char*,va_list);
15016
+ int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*);
15017
+ /* Version 3.8.7 and later */
15018
+ int (*auto_extension)(void(*)(void));
15019
+ int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64,
15020
+ void(*)(void*));
15021
+ int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64,
15022
+ void(*)(void*),unsigned char);
15023
+ int (*cancel_auto_extension)(void(*)(void));
15024
+ int (*load_extension)(sqlite3*,const char*,const char*,char**);
15025
+ void *(*malloc64)(sqlite3_uint64);
15026
+ sqlite3_uint64 (*msize)(void*);
15027
+ void *(*realloc64)(void*,sqlite3_uint64);
15028
+ void (*reset_auto_extension)(void);
15029
+ void (*result_blob64)(sqlite3_context*,const void*,sqlite3_uint64,
15030
+ void(*)(void*));
15031
+ void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64,
15032
+ void(*)(void*), unsigned char);
15033
+ int (*strglob)(const char*,const char*);
15034
+ /* Version 3.8.11 and later */
15035
+ sqlite3_value *(*value_dup)(const sqlite3_value*);
15036
+ void (*value_free)(sqlite3_value*);
15037
+ int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64);
15038
+ int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64);
15039
+ /* Version 3.9.0 and later */
15040
+ unsigned int (*value_subtype)(sqlite3_value*);
15041
+ void (*result_subtype)(sqlite3_context*,unsigned int);
15042
+ /* Version 3.10.0 and later */
15043
+ int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int);
15044
+ int (*strlike)(const char*,const char*,unsigned int);
15045
+ int (*db_cacheflush)(sqlite3*);
15046
+ /* Version 3.12.0 and later */
15047
+ int (*system_errno)(sqlite3*);
15048
+ /* Version 3.14.0 and later */
15049
+ int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*);
15050
+ char *(*expanded_sql)(sqlite3_stmt*);
15051
+ /* Version 3.18.0 and later */
15052
+ void (*set_last_insert_rowid)(sqlite3*,sqlite3_int64);
15053
+ /* Version 3.20.0 and later */
15054
+ int (*prepare_v3)(sqlite3*,const char*,int,unsigned int,
15055
+ sqlite3_stmt**,const char**);
15056
+ int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int,
15057
+ sqlite3_stmt**,const void**);
15058
+ int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*));
15059
+ void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*));
15060
+ void *(*value_pointer)(sqlite3_value*,const char*);
15061
+ int (*vtab_nochange)(sqlite3_context*);
15062
+ int (*value_nochange)(sqlite3_value*);
15063
+ const char *(*vtab_collation)(sqlite3_index_info*,int);
15064
+ /* Version 3.24.0 and later */
15065
+ int (*keyword_count)(void);
15066
+ int (*keyword_name)(int,const char**,int*);
15067
+ int (*keyword_check)(const char*,int);
15068
+ sqlite3_str *(*str_new)(sqlite3*);
15069
+ char *(*str_finish)(sqlite3_str*);
15070
+ void (SQLITE_CDECL*str_appendf)(sqlite3_str*, const char *zFormat, ...);
15071
+ void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list);
15072
+ void (*str_append)(sqlite3_str*, const char *zIn, int N);
15073
+ void (*str_appendall)(sqlite3_str*, const char *zIn);
15074
+ void (*str_appendchar)(sqlite3_str*, int N, char C);
15075
+ void (*str_reset)(sqlite3_str*);
15076
+ int (*str_errcode)(sqlite3_str*);
15077
+ int (*str_length)(sqlite3_str*);
15078
+ char *(*str_value)(sqlite3_str*);
15079
+ /* Version 3.25.0 and later */
15080
+ int (*create_window_function)(sqlite3*,const char*,int,int,void*,
15081
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
15082
+ void (*xFinal)(sqlite3_context*),
15083
+ void (*xValue)(sqlite3_context*),
15084
+ void (*xInv)(sqlite3_context*,int,sqlite3_value**),
15085
+ void(*xDestroy)(void*));
15086
+ /* Version 3.26.0 and later */
15087
+ const char *(*normalized_sql)(sqlite3_stmt*);
15088
+ /* Version 3.28.0 and later */
15089
+ int (*stmt_isexplain)(sqlite3_stmt*);
15090
+ int (*value_frombind)(sqlite3_value*);
15091
+ /* Version 3.30.0 and later */
15092
+ int (*drop_modules)(sqlite3*,const char**);
15093
+ /* Version 3.31.0 and later */
15094
+ sqlite3_int64 (*hard_heap_limit64)(sqlite3_int64);
15095
+ const char *(*uri_key)(const char*,int);
15096
+ const char *(*filename_database)(const char*);
15097
+ const char *(*filename_journal)(const char*);
15098
+ const char *(*filename_wal)(const char*);
15099
+ /* Version 3.32.0 and later */
15100
+ const char *(*create_filename)(const char*,const char*,const char*,
15101
+ int,const char**);
15102
+ void (*free_filename)(const char*);
15103
+ sqlite3_file *(*database_file_object)(const char*);
15104
+ /* Version 3.34.0 and later */
15105
+ int (*txn_state)(sqlite3*,const char*);
15106
+ /* Version 3.36.1 and later */
15107
+ sqlite3_int64 (*changes64)(sqlite3*);
15108
+ sqlite3_int64 (*total_changes64)(sqlite3*);
15109
+ /* Version 3.37.0 and later */
15110
+ int (*autovacuum_pages)(sqlite3*,
15111
+ unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
15112
+ void*, void(*)(void*));
15113
+ /* Version 3.38.0 and later */
15114
+ int (*error_offset)(sqlite3*);
15115
+ int (*vtab_rhs_value)(sqlite3_index_info*,int,sqlite3_value**);
15116
+ int (*vtab_distinct)(sqlite3_index_info*);
15117
+ int (*vtab_in)(sqlite3_index_info*,int,int);
15118
+ int (*vtab_in_first)(sqlite3_value*,sqlite3_value**);
15119
+ int (*vtab_in_next)(sqlite3_value*,sqlite3_value**);
15120
+ /* Version 3.39.0 and later */
15121
+ int (*deserialize)(sqlite3*,const char*,unsigned char*,
15122
+ sqlite3_int64,sqlite3_int64,unsigned);
15123
+ unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*,
15124
+ unsigned int);
15125
+ const char *(*db_name)(sqlite3*,int);
15126
+ /* Version 3.40.0 and later */
15127
+ int (*value_encoding)(sqlite3_value*);
15128
+ /* Version 3.41.0 and later */
15129
+ int (*is_interrupted)(sqlite3*);
15130
+ /* Version 3.43.0 and later */
15131
+ int (*stmt_explain)(sqlite3_stmt*,int);
15132
+ /* Version 3.44.0 and later */
15133
+ void *(*get_clientdata)(sqlite3*,const char*);
15134
+ int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*));
15135
+ /* Version 3.50.0 and later */
15136
+ int (*setlk_timeout)(sqlite3*,int,int);
15137
+ /* Version 3.51.0 and later */
15138
+ int (*set_errmsg)(sqlite3*,int,const char*);
15139
+ int (*db_status64)(sqlite3*,int,sqlite3_int64*,sqlite3_int64*,int);
15140
+ /* Version 3.52.0 and later */
15141
+ void (*str_truncate)(sqlite3_str*,int);
15142
+ void (*str_free)(sqlite3_str*);
15143
+ int (*carray_bind)(sqlite3_stmt*,int,void*,int,int,void(*)(void*));
15144
+ int (*carray_bind_v2)(sqlite3_stmt*,int,void*,int,int,void(*)(void*),void*);
15145
+ /* Version 3.54.0 and later */
15146
+ sqlite3_int64 (*incomplete)(const char*);
15147
+ void (*result_str)(sqlite3_context*,sqlite3_str*,int);
15148
+ };
15149
+
15150
+ /*
15151
+ ** This is the function signature used for all extension entry points. It
15152
+ ** is also defined in the file "loadext.c".
15153
+ */
15154
+ typedef int (*sqlite3_loadext_entry)(
15155
+ sqlite3 *db, /* Handle to the database. */
15156
+ char **pzErrMsg, /* Used to set error string on failure. */
15157
+ const sqlite3_api_routines *pThunk /* Extension API function pointers. */
15158
+ );
15159
+
15160
+ /*
15161
+ ** The following macros redefine the API routines so that they are
15162
+ ** redirected through the global sqlite3_api structure.
15163
+ **
15164
+ ** This header file is also used by the loadext.c source file
15165
+ ** (part of the main SQLite library - not an extension) so that
15166
+ ** it can get access to the sqlite3_api_routines structure
15167
+ ** definition. But the main library does not want to redefine
15168
+ ** the API. So the redefinition macros are only valid if the
15169
+ ** SQLITE_CORE macros is undefined.
15170
+ */
15171
+ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
15172
+ #define sqlite3_aggregate_context sqlite3_api->aggregate_context
15173
+ #ifndef SQLITE_OMIT_DEPRECATED
15174
+ #define sqlite3_aggregate_count sqlite3_api->aggregate_count
15175
+ #endif
15176
+ #define sqlite3_bind_blob sqlite3_api->bind_blob
15177
+ #define sqlite3_bind_double sqlite3_api->bind_double
15178
+ #define sqlite3_bind_int sqlite3_api->bind_int
15179
+ #define sqlite3_bind_int64 sqlite3_api->bind_int64
15180
+ #define sqlite3_bind_null sqlite3_api->bind_null
15181
+ #define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count
15182
+ #define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index
15183
+ #define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name
15184
+ #define sqlite3_bind_text sqlite3_api->bind_text
15185
+ #define sqlite3_bind_text16 sqlite3_api->bind_text16
15186
+ #define sqlite3_bind_value sqlite3_api->bind_value
15187
+ #define sqlite3_busy_handler sqlite3_api->busy_handler
15188
+ #define sqlite3_busy_timeout sqlite3_api->busy_timeout
15189
+ #define sqlite3_changes sqlite3_api->changes
15190
+ #define sqlite3_close sqlite3_api->close
15191
+ #define sqlite3_collation_needed sqlite3_api->collation_needed
15192
+ #define sqlite3_collation_needed16 sqlite3_api->collation_needed16
15193
+ #define sqlite3_column_blob sqlite3_api->column_blob
15194
+ #define sqlite3_column_bytes sqlite3_api->column_bytes
15195
+ #define sqlite3_column_bytes16 sqlite3_api->column_bytes16
15196
+ #define sqlite3_column_count sqlite3_api->column_count
15197
+ #define sqlite3_column_database_name sqlite3_api->column_database_name
15198
+ #define sqlite3_column_database_name16 sqlite3_api->column_database_name16
15199
+ #define sqlite3_column_decltype sqlite3_api->column_decltype
15200
+ #define sqlite3_column_decltype16 sqlite3_api->column_decltype16
15201
+ #define sqlite3_column_double sqlite3_api->column_double
15202
+ #define sqlite3_column_int sqlite3_api->column_int
15203
+ #define sqlite3_column_int64 sqlite3_api->column_int64
15204
+ #define sqlite3_column_name sqlite3_api->column_name
15205
+ #define sqlite3_column_name16 sqlite3_api->column_name16
15206
+ #define sqlite3_column_origin_name sqlite3_api->column_origin_name
15207
+ #define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16
15208
+ #define sqlite3_column_table_name sqlite3_api->column_table_name
15209
+ #define sqlite3_column_table_name16 sqlite3_api->column_table_name16
15210
+ #define sqlite3_column_text sqlite3_api->column_text
15211
+ #define sqlite3_column_text16 sqlite3_api->column_text16
15212
+ #define sqlite3_column_type sqlite3_api->column_type
15213
+ #define sqlite3_column_value sqlite3_api->column_value
15214
+ #define sqlite3_commit_hook sqlite3_api->commit_hook
15215
+ #define sqlite3_complete sqlite3_api->complete
15216
+ #define sqlite3_complete16 sqlite3_api->complete16
15217
+ #define sqlite3_create_collation sqlite3_api->create_collation
15218
+ #define sqlite3_create_collation16 sqlite3_api->create_collation16
15219
+ #define sqlite3_create_function sqlite3_api->create_function
15220
+ #define sqlite3_create_function16 sqlite3_api->create_function16
15221
+ #define sqlite3_create_module sqlite3_api->create_module
15222
+ #define sqlite3_create_module_v2 sqlite3_api->create_module_v2
15223
+ #define sqlite3_data_count sqlite3_api->data_count
15224
+ #define sqlite3_db_handle sqlite3_api->db_handle
15225
+ #define sqlite3_declare_vtab sqlite3_api->declare_vtab
15226
+ #define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache
15227
+ #define sqlite3_errcode sqlite3_api->errcode
15228
+ #define sqlite3_errmsg sqlite3_api->errmsg
15229
+ #define sqlite3_errmsg16 sqlite3_api->errmsg16
15230
+ #define sqlite3_exec sqlite3_api->exec
15231
+ #ifndef SQLITE_OMIT_DEPRECATED
15232
+ #define sqlite3_expired sqlite3_api->expired
15233
+ #endif
15234
+ #define sqlite3_finalize sqlite3_api->finalize
15235
+ #define sqlite3_free sqlite3_api->free
15236
+ #define sqlite3_free_table sqlite3_api->free_table
15237
+ #define sqlite3_get_autocommit sqlite3_api->get_autocommit
15238
+ #define sqlite3_get_auxdata sqlite3_api->get_auxdata
15239
+ #define sqlite3_get_table sqlite3_api->get_table
15240
+ #ifndef SQLITE_OMIT_DEPRECATED
15241
+ #define sqlite3_global_recover sqlite3_api->global_recover
15242
+ #endif
15243
+ #define sqlite3_interrupt sqlite3_api->interruptx
15244
+ #define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid
15245
+ #define sqlite3_libversion sqlite3_api->libversion
15246
+ #define sqlite3_libversion_number sqlite3_api->libversion_number
15247
+ #define sqlite3_malloc sqlite3_api->malloc
15248
+ #define sqlite3_mprintf sqlite3_api->mprintf
15249
+ #define sqlite3_open sqlite3_api->open
15250
+ #define sqlite3_open16 sqlite3_api->open16
15251
+ #define sqlite3_prepare sqlite3_api->prepare
15252
+ #define sqlite3_prepare16 sqlite3_api->prepare16
15253
+ #define sqlite3_prepare_v2 sqlite3_api->prepare_v2
15254
+ #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
15255
+ #define sqlite3_profile sqlite3_api->profile
15256
+ #define sqlite3_progress_handler sqlite3_api->progress_handler
15257
+ #define sqlite3_realloc sqlite3_api->realloc
15258
+ #define sqlite3_reset sqlite3_api->reset
15259
+ #define sqlite3_result_blob sqlite3_api->result_blob
15260
+ #define sqlite3_result_double sqlite3_api->result_double
15261
+ #define sqlite3_result_error sqlite3_api->result_error
15262
+ #define sqlite3_result_error16 sqlite3_api->result_error16
15263
+ #define sqlite3_result_int sqlite3_api->result_int
15264
+ #define sqlite3_result_int64 sqlite3_api->result_int64
15265
+ #define sqlite3_result_null sqlite3_api->result_null
15266
+ #define sqlite3_result_text sqlite3_api->result_text
15267
+ #define sqlite3_result_text16 sqlite3_api->result_text16
15268
+ #define sqlite3_result_text16be sqlite3_api->result_text16be
15269
+ #define sqlite3_result_text16le sqlite3_api->result_text16le
15270
+ #define sqlite3_result_value sqlite3_api->result_value
15271
+ #define sqlite3_rollback_hook sqlite3_api->rollback_hook
15272
+ #define sqlite3_set_authorizer sqlite3_api->set_authorizer
15273
+ #define sqlite3_set_auxdata sqlite3_api->set_auxdata
15274
+ #define sqlite3_snprintf sqlite3_api->xsnprintf
15275
+ #define sqlite3_step sqlite3_api->step
15276
+ #define sqlite3_table_column_metadata sqlite3_api->table_column_metadata
15277
+ #define sqlite3_thread_cleanup sqlite3_api->thread_cleanup
15278
+ #define sqlite3_total_changes sqlite3_api->total_changes
15279
+ #define sqlite3_trace sqlite3_api->trace
15280
+ #ifndef SQLITE_OMIT_DEPRECATED
15281
+ #define sqlite3_transfer_bindings sqlite3_api->transfer_bindings
15282
+ #endif
15283
+ #define sqlite3_update_hook sqlite3_api->update_hook
15284
+ #define sqlite3_user_data sqlite3_api->user_data
15285
+ #define sqlite3_value_blob sqlite3_api->value_blob
15286
+ #define sqlite3_value_bytes sqlite3_api->value_bytes
15287
+ #define sqlite3_value_bytes16 sqlite3_api->value_bytes16
15288
+ #define sqlite3_value_double sqlite3_api->value_double
15289
+ #define sqlite3_value_int sqlite3_api->value_int
15290
+ #define sqlite3_value_int64 sqlite3_api->value_int64
15291
+ #define sqlite3_value_numeric_type sqlite3_api->value_numeric_type
15292
+ #define sqlite3_value_text sqlite3_api->value_text
15293
+ #define sqlite3_value_text16 sqlite3_api->value_text16
15294
+ #define sqlite3_value_text16be sqlite3_api->value_text16be
15295
+ #define sqlite3_value_text16le sqlite3_api->value_text16le
15296
+ #define sqlite3_value_type sqlite3_api->value_type
15297
+ #define sqlite3_vmprintf sqlite3_api->vmprintf
15298
+ #define sqlite3_vsnprintf sqlite3_api->xvsnprintf
15299
+ #define sqlite3_overload_function sqlite3_api->overload_function
15300
+ #define sqlite3_prepare_v2 sqlite3_api->prepare_v2
15301
+ #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2
15302
+ #define sqlite3_clear_bindings sqlite3_api->clear_bindings
15303
+ #define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob
15304
+ #define sqlite3_blob_bytes sqlite3_api->blob_bytes
15305
+ #define sqlite3_blob_close sqlite3_api->blob_close
15306
+ #define sqlite3_blob_open sqlite3_api->blob_open
15307
+ #define sqlite3_blob_read sqlite3_api->blob_read
15308
+ #define sqlite3_blob_write sqlite3_api->blob_write
15309
+ #define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2
15310
+ #define sqlite3_file_control sqlite3_api->file_control
15311
+ #define sqlite3_memory_highwater sqlite3_api->memory_highwater
15312
+ #define sqlite3_memory_used sqlite3_api->memory_used
15313
+ #define sqlite3_mutex_alloc sqlite3_api->mutex_alloc
15314
+ #define sqlite3_mutex_enter sqlite3_api->mutex_enter
15315
+ #define sqlite3_mutex_free sqlite3_api->mutex_free
15316
+ #define sqlite3_mutex_leave sqlite3_api->mutex_leave
15317
+ #define sqlite3_mutex_try sqlite3_api->mutex_try
15318
+ #define sqlite3_open_v2 sqlite3_api->open_v2
15319
+ #define sqlite3_release_memory sqlite3_api->release_memory
15320
+ #define sqlite3_result_error_nomem sqlite3_api->result_error_nomem
15321
+ #define sqlite3_result_error_toobig sqlite3_api->result_error_toobig
15322
+ #define sqlite3_sleep sqlite3_api->sleep
15323
+ #define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit
15324
+ #define sqlite3_vfs_find sqlite3_api->vfs_find
15325
+ #define sqlite3_vfs_register sqlite3_api->vfs_register
15326
+ #define sqlite3_vfs_unregister sqlite3_api->vfs_unregister
15327
+ #define sqlite3_threadsafe sqlite3_api->xthreadsafe
15328
+ #define sqlite3_result_zeroblob sqlite3_api->result_zeroblob
15329
+ #define sqlite3_result_error_code sqlite3_api->result_error_code
15330
+ #define sqlite3_test_control sqlite3_api->test_control
15331
+ #define sqlite3_randomness sqlite3_api->randomness
15332
+ #define sqlite3_context_db_handle sqlite3_api->context_db_handle
15333
+ #define sqlite3_extended_result_codes sqlite3_api->extended_result_codes
15334
+ #define sqlite3_limit sqlite3_api->limit
15335
+ #define sqlite3_next_stmt sqlite3_api->next_stmt
15336
+ #define sqlite3_sql sqlite3_api->sql
15337
+ #define sqlite3_status sqlite3_api->status
15338
+ #define sqlite3_backup_finish sqlite3_api->backup_finish
15339
+ #define sqlite3_backup_init sqlite3_api->backup_init
15340
+ #define sqlite3_backup_pagecount sqlite3_api->backup_pagecount
15341
+ #define sqlite3_backup_remaining sqlite3_api->backup_remaining
15342
+ #define sqlite3_backup_step sqlite3_api->backup_step
15343
+ #define sqlite3_compileoption_get sqlite3_api->compileoption_get
15344
+ #define sqlite3_compileoption_used sqlite3_api->compileoption_used
15345
+ #define sqlite3_create_function_v2 sqlite3_api->create_function_v2
15346
+ #define sqlite3_db_config sqlite3_api->db_config
15347
+ #define sqlite3_db_mutex sqlite3_api->db_mutex
15348
+ #define sqlite3_db_status sqlite3_api->db_status
15349
+ #define sqlite3_extended_errcode sqlite3_api->extended_errcode
15350
+ #define sqlite3_log sqlite3_api->log
15351
+ #define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64
15352
+ #define sqlite3_sourceid sqlite3_api->sourceid
15353
+ #define sqlite3_stmt_status sqlite3_api->stmt_status
15354
+ #define sqlite3_strnicmp sqlite3_api->strnicmp
15355
+ #define sqlite3_unlock_notify sqlite3_api->unlock_notify
15356
+ #define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint
15357
+ #define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint
15358
+ #define sqlite3_wal_hook sqlite3_api->wal_hook
15359
+ #define sqlite3_blob_reopen sqlite3_api->blob_reopen
15360
+ #define sqlite3_vtab_config sqlite3_api->vtab_config
15361
+ #define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict
15362
+ /* Version 3.7.16 and later */
15363
+ #define sqlite3_close_v2 sqlite3_api->close_v2
15364
+ #define sqlite3_db_filename sqlite3_api->db_filename
15365
+ #define sqlite3_db_readonly sqlite3_api->db_readonly
15366
+ #define sqlite3_db_release_memory sqlite3_api->db_release_memory
15367
+ #define sqlite3_errstr sqlite3_api->errstr
15368
+ #define sqlite3_stmt_busy sqlite3_api->stmt_busy
15369
+ #define sqlite3_stmt_readonly sqlite3_api->stmt_readonly
15370
+ #define sqlite3_stricmp sqlite3_api->stricmp
15371
+ #define sqlite3_uri_boolean sqlite3_api->uri_boolean
15372
+ #define sqlite3_uri_int64 sqlite3_api->uri_int64
15373
+ #define sqlite3_uri_parameter sqlite3_api->uri_parameter
15374
+ #define sqlite3_uri_vsnprintf sqlite3_api->xvsnprintf
15375
+ #define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2
15376
+ /* Version 3.8.7 and later */
15377
+ #define sqlite3_auto_extension sqlite3_api->auto_extension
15378
+ #define sqlite3_bind_blob64 sqlite3_api->bind_blob64
15379
+ #define sqlite3_bind_text64 sqlite3_api->bind_text64
15380
+ #define sqlite3_cancel_auto_extension sqlite3_api->cancel_auto_extension
15381
+ #define sqlite3_load_extension sqlite3_api->load_extension
15382
+ #define sqlite3_malloc64 sqlite3_api->malloc64
15383
+ #define sqlite3_msize sqlite3_api->msize
15384
+ #define sqlite3_realloc64 sqlite3_api->realloc64
15385
+ #define sqlite3_reset_auto_extension sqlite3_api->reset_auto_extension
15386
+ #define sqlite3_result_blob64 sqlite3_api->result_blob64
15387
+ #define sqlite3_result_text64 sqlite3_api->result_text64
15388
+ #define sqlite3_strglob sqlite3_api->strglob
15389
+ /* Version 3.8.11 and later */
15390
+ #define sqlite3_value_dup sqlite3_api->value_dup
15391
+ #define sqlite3_value_free sqlite3_api->value_free
15392
+ #define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64
15393
+ #define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64
15394
+ /* Version 3.9.0 and later */
15395
+ #define sqlite3_value_subtype sqlite3_api->value_subtype
15396
+ #define sqlite3_result_subtype sqlite3_api->result_subtype
15397
+ /* Version 3.10.0 and later */
15398
+ #define sqlite3_status64 sqlite3_api->status64
15399
+ #define sqlite3_strlike sqlite3_api->strlike
15400
+ #define sqlite3_db_cacheflush sqlite3_api->db_cacheflush
15401
+ /* Version 3.12.0 and later */
15402
+ #define sqlite3_system_errno sqlite3_api->system_errno
15403
+ /* Version 3.14.0 and later */
15404
+ #define sqlite3_trace_v2 sqlite3_api->trace_v2
15405
+ #define sqlite3_expanded_sql sqlite3_api->expanded_sql
15406
+ /* Version 3.18.0 and later */
15407
+ #define sqlite3_set_last_insert_rowid sqlite3_api->set_last_insert_rowid
15408
+ /* Version 3.20.0 and later */
15409
+ #define sqlite3_prepare_v3 sqlite3_api->prepare_v3
15410
+ #define sqlite3_prepare16_v3 sqlite3_api->prepare16_v3
15411
+ #define sqlite3_bind_pointer sqlite3_api->bind_pointer
15412
+ #define sqlite3_result_pointer sqlite3_api->result_pointer
15413
+ #define sqlite3_value_pointer sqlite3_api->value_pointer
15414
+ /* Version 3.22.0 and later */
15415
+ #define sqlite3_vtab_nochange sqlite3_api->vtab_nochange
15416
+ #define sqlite3_value_nochange sqlite3_api->value_nochange
15417
+ #define sqlite3_vtab_collation sqlite3_api->vtab_collation
15418
+ /* Version 3.24.0 and later */
15419
+ #define sqlite3_keyword_count sqlite3_api->keyword_count
15420
+ #define sqlite3_keyword_name sqlite3_api->keyword_name
15421
+ #define sqlite3_keyword_check sqlite3_api->keyword_check
15422
+ #define sqlite3_str_new sqlite3_api->str_new
15423
+ #define sqlite3_str_finish sqlite3_api->str_finish
15424
+ #define sqlite3_str_appendf sqlite3_api->str_appendf
15425
+ #define sqlite3_str_vappendf sqlite3_api->str_vappendf
15426
+ #define sqlite3_str_append sqlite3_api->str_append
15427
+ #define sqlite3_str_appendall sqlite3_api->str_appendall
15428
+ #define sqlite3_str_appendchar sqlite3_api->str_appendchar
15429
+ #define sqlite3_str_reset sqlite3_api->str_reset
15430
+ #define sqlite3_str_errcode sqlite3_api->str_errcode
15431
+ #define sqlite3_str_length sqlite3_api->str_length
15432
+ #define sqlite3_str_value sqlite3_api->str_value
15433
+ /* Version 3.25.0 and later */
15434
+ #define sqlite3_create_window_function sqlite3_api->create_window_function
15435
+ /* Version 3.26.0 and later */
15436
+ #define sqlite3_normalized_sql sqlite3_api->normalized_sql
15437
+ /* Version 3.28.0 and later */
15438
+ #define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain
15439
+ #define sqlite3_value_frombind sqlite3_api->value_frombind
15440
+ /* Version 3.30.0 and later */
15441
+ #define sqlite3_drop_modules sqlite3_api->drop_modules
15442
+ /* Version 3.31.0 and later */
15443
+ #define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64
15444
+ #define sqlite3_uri_key sqlite3_api->uri_key
15445
+ #define sqlite3_filename_database sqlite3_api->filename_database
15446
+ #define sqlite3_filename_journal sqlite3_api->filename_journal
15447
+ #define sqlite3_filename_wal sqlite3_api->filename_wal
15448
+ /* Version 3.32.0 and later */
15449
+ #define sqlite3_create_filename sqlite3_api->create_filename
15450
+ #define sqlite3_free_filename sqlite3_api->free_filename
15451
+ #define sqlite3_database_file_object sqlite3_api->database_file_object
15452
+ /* Version 3.34.0 and later */
15453
+ #define sqlite3_txn_state sqlite3_api->txn_state
15454
+ /* Version 3.36.1 and later */
15455
+ #define sqlite3_changes64 sqlite3_api->changes64
15456
+ #define sqlite3_total_changes64 sqlite3_api->total_changes64
15457
+ /* Version 3.37.0 and later */
15458
+ #define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages
15459
+ /* Version 3.38.0 and later */
15460
+ #define sqlite3_error_offset sqlite3_api->error_offset
15461
+ #define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value
15462
+ #define sqlite3_vtab_distinct sqlite3_api->vtab_distinct
15463
+ #define sqlite3_vtab_in sqlite3_api->vtab_in
15464
+ #define sqlite3_vtab_in_first sqlite3_api->vtab_in_first
15465
+ #define sqlite3_vtab_in_next sqlite3_api->vtab_in_next
15466
+ /* Version 3.39.0 and later */
15467
+ #ifndef SQLITE_OMIT_DESERIALIZE
15468
+ #define sqlite3_deserialize sqlite3_api->deserialize
15469
+ #define sqlite3_serialize sqlite3_api->serialize
15470
+ #endif
15471
+ #define sqlite3_db_name sqlite3_api->db_name
15472
+ /* Version 3.40.0 and later */
15473
+ #define sqlite3_value_encoding sqlite3_api->value_encoding
15474
+ /* Version 3.41.0 and later */
15475
+ #define sqlite3_is_interrupted sqlite3_api->is_interrupted
15476
+ /* Version 3.43.0 and later */
15477
+ #define sqlite3_stmt_explain sqlite3_api->stmt_explain
15478
+ /* Version 3.44.0 and later */
15479
+ #define sqlite3_get_clientdata sqlite3_api->get_clientdata
15480
+ #define sqlite3_set_clientdata sqlite3_api->set_clientdata
15481
+ /* Version 3.50.0 and later */
15482
+ #define sqlite3_setlk_timeout sqlite3_api->setlk_timeout
15483
+ /* Version 3.51.0 and later */
15484
+ #define sqlite3_set_errmsg sqlite3_api->set_errmsg
15485
+ #define sqlite3_db_status64 sqlite3_api->db_status64
15486
+ /* Version 3.52.0 and later */
15487
+ #define sqlite3_str_truncate sqlite3_api->str_truncate
15488
+ #define sqlite3_str_free sqlite3_api->str_free
15489
+ #define sqlite3_carray_bind sqlite3_api->carray_bind
15490
+ #define sqlite3_carray_bind_v2 sqlite3_api->carray_bind_v2
15491
+ /* Version 3.54.0 and later */
15492
+ #define sqlite3_incomplete sqlite3_api->incomplete
15493
+ #define sqlite3_result_str sqlite3_api->result_str
15494
+ #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
15495
+
15496
+ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
15497
+ /* This case when the file really is being compiled as a loadable
15498
+ ** extension */
15499
+ # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0;
15500
+ # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v;
15501
+ # define SQLITE_EXTENSION_INIT3 \
15502
+ extern const sqlite3_api_routines *sqlite3_api;
15503
+ #else
15504
+ /* This case when the file is being statically linked into the
15505
+ ** application */
15506
+ # define SQLITE_EXTENSION_INIT1 /*no-op*/
15507
+ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */
15508
+ # define SQLITE_EXTENSION_INIT3 /*no-op*/
15509
+ #endif
15510
+
15511
+ #endif /* SQLITE3EXT_H */
15512
+ /*** End of #include "sqlite3ext.h" ***/
15513
+
15514
+
15515
+ struct sqlite3mc_core_routines {
15516
+ int (*initialize)(void);
15517
+ int (*shutdown)(void);
15518
+ int (*config)(int, ...);
15519
+ int (*enable_load_extension)(sqlite3*, int);
15520
+ int (*memory_alarm)(void(*)(void*, sqlite3_int64, int), void*, sqlite3_int64);
15521
+ int (*mutex_held)(sqlite3_mutex*);
15522
+ int (*mutex_notheld)(sqlite3_mutex*);
15523
+ int (*os_init)(void);
15524
+ int (*os_end)(void);
15525
+ int (*preupdate_blobwrite)(sqlite3*);
15526
+ int (*preupdate_count)(sqlite3*);
15527
+ int (*preupdate_depth)(sqlite3*);
15528
+ void* (*preupdate_hook)(sqlite3*,
15529
+ void(*xPreUpdate)(void*, sqlite3*, int, char const*, char const*, sqlite3_int64, sqlite3_int64),
15530
+ void*);
15531
+ int (*preupdate_old)(sqlite3*, int, sqlite3_value**);
15532
+ int (*preupdate_new)(sqlite3*, int, sqlite3_value**);
15533
+
15534
+ int (*snapshot_cmp)(sqlite3_snapshot*, sqlite3_snapshot*);
15535
+ void (*snapshot_free)(sqlite3_snapshot*);
15536
+ int (*snapshot_get)(sqlite3*, const char*, sqlite3_snapshot**);
15537
+ int (*snapshot_open)(sqlite3*, const char*, sqlite3_snapshot*);
15538
+ int (*snapshot_recover)(sqlite3*, const char*);
15539
+
15540
+ int (*stmt_scanstatus)(sqlite3_stmt*, int, int, void*);
15541
+ int (*stmt_scanstatus_v2)(sqlite3_stmt*, int, int, int, void*);
15542
+ void (*stmt_scanstatus_reset)(sqlite3_stmt*);
15543
+
15544
+ int (*win32_set_directory)(unsigned long type, void* zValue);
15545
+ int (*win32_set_directory8)(unsigned long type, const char* zValue);
15546
+ int (*win32_set_directory16)(unsigned long type, const void* zValue);
15547
+ };
15548
+
15549
+ struct sqlite3mc_api_routines {
15550
+ void (*activate_see)(const char* zPassPhrase);
15551
+ int (*key)(sqlite3* db, const void* pKey, int nKey);
15552
+ int (*key_v2)(sqlite3*, const char* zDbName, const void* pKey, int nKey);
15553
+ int (*rekey)(sqlite3*, const void* pKey, int nKey);
15554
+ int (*rekey_v2)(sqlite3*, const char* zDbName, const void* pKey, int nKey);
15555
+
15556
+ const char* (*mc_version)();
15557
+ int (*mc_cipher_count)();
15558
+ int (*mc_cipher_index)(const char* cipherName);
15559
+ const char* (*mc_cipher_name)(int cipherIndex);
15560
+ int (*mc_cipher_name_copy)(int cipherIndex, char* cipherName, int maxCipherNameSize);
15561
+ int (*mc_config)(sqlite3* db, const char* paramName, int newValue);
15562
+ int (*mc_config_cipher)(sqlite3* db, const char* cipherName, const char* paramName, int newValue);
15563
+ unsigned char* (*mc_codec_data)(sqlite3* db, const char* zDbName, const char* paramName);
15564
+
15565
+ int (*mc_vfs_create)(const char* zVfsReal, int makeDefault);
15566
+ void (*mc_vfs_destroy)(const char* zName);
15567
+ void (*mc_vfs_shutdown)();
15568
+ };
15569
+
15570
+ typedef struct sqlite3mc_core_routines sqlite3mc_core_routines;
15571
+ typedef struct sqlite3mc_api_routines sqlite3mc_api_routines;
15572
+
15573
+ #ifndef SQLITE3MC_DISPATCH_API
15574
+ #if defined(_WIN32)
15575
+ #define SQLITE3MC_DISPATCH_API __declspec(dllexport)
15576
+ #else
15577
+ #define SQLITE3MC_DISPATCH_API
15578
+ #endif
15579
+ #endif
15580
+
15581
+ #ifdef __cplusplus
15582
+ extern "C" {
14622
15583
  #endif
15584
+
15585
+ SQLITE3MC_DISPATCH_API extern const sqlite3_api_routines* SQLITE3MC_API_TABLE_EXT;
15586
+ SQLITE3MC_DISPATCH_API extern const sqlite3mc_core_routines* SQLITE3MC_API_TABLE_CORE;
15587
+ SQLITE3MC_DISPATCH_API extern const sqlite3mc_api_routines* SQLITE3MC_API_TABLE_MC;
15588
+
15589
+ #ifdef __cplusplus
15590
+ } /* End of the 'extern "C"' block */
15591
+ #endif
15592
+
15593
+ #if !defined(SQLITE_CORE)
15594
+
15595
+ /* SQLite core API - not defined in sqlite3ext.h */
15596
+
15597
+ #define sqlite3_initialize SQLITE3MC_API_TABLE_CORE->initialize
15598
+ #define sqlite3_shutdown SQLITE3MC_API_TABLE_CORE->shutdown
15599
+ #define sqlite3_config SQLITE3MC_API_TABLE_CORE->config
15600
+ #define sqlite3_enable_load_extension SQLITE3MC_API_TABLE_CORE->enable_load_extension
15601
+ #define sqlite3_memory_alarm SQLITE3MC_API_TABLE_CORE->memory_alarm
15602
+ #define sqlite3_mutex_held SQLITE3MC_API_TABLE_CORE->mutex_held
15603
+ #define sqlite3_mutex_notheld SQLITE3MC_API_TABLE_CORE->mutex_notheld
15604
+ #define sqlite3_os_init SQLITE3MC_API_TABLE_CORE->os_init
15605
+ #define sqlite3_os_end SQLITE3MC_API_TABLE_CORE->os_end
15606
+ #define sqlite3_preupdate_blobwrite SQLITE3MC_API_TABLE_CORE->preupdate_blobwrite
15607
+ #define sqlite3_preupdate_count SQLITE3MC_API_TABLE_CORE->preupdate_count
15608
+ #define sqlite3_preupdate_depth SQLITE3MC_API_TABLE_CORE->preupdate_depth
15609
+ #define sqlite3_preupdate_hook SQLITE3MC_API_TABLE_CORE->preupdate_hook
15610
+ #define sqlite3_preupdate_old SQLITE3MC_API_TABLE_CORE->preupdate_old
15611
+ #define sqlite3_preupdate_new SQLITE3MC_API_TABLE_CORE->preupdate_new
15612
+
15613
+ #define sqlite3_snapshot_cmp SQLITE3MC_API_TABLE_CORE->snapshot_cmp
15614
+ #define sqlite3_snapshot_free SQLITE3MC_API_TABLE_CORE->snapshot_free
15615
+ #define sqlite3_snapshot_get SQLITE3MC_API_TABLE_CORE->snapshot_get
15616
+ #define sqlite3_snapshot_open SQLITE3MC_API_TABLE_CORE->snapshot_open
15617
+ #define sqlite3_snapshot_recover SQLITE3MC_API_TABLE_CORE->snapshot_recover
15618
+
15619
+ #define sqlite3_stmt_scanstatus SQLITE3MC_API_TABLE_CORE->stmt_scanstatus
15620
+ #define sqlite3_stmt_scanstatus_v2 SQLITE3MC_API_TABLE_CORE->stmt_scanstatus_v2
15621
+ #define sqlite3_stmt_scanstatus_reset SQLITE3MC_API_TABLE_CORE->stmt_scanstatus_reset
15622
+
15623
+ #define sqlite3_win32_set_directory SQLITE3MC_API_TABLE_CORE->win32_set_directory
15624
+ #define sqlite3_win32_set_directory8 SQLITE3MC_API_TABLE_CORE->win32_set_directory8
15625
+ #define sqlite3_win32_set_directory16 SQLITE3MC_API_TABLE_CORE->win32_set_directory16
15626
+
15627
+ /* SQLite3 Multiple Ciphers API */
15628
+
15629
+ #define sqlite3_activate_see SQLITE3MC_API_TABLE_MC->activate_see
15630
+ #define sqlite3_key SQLITE3MC_API_TABLE_MC->key
15631
+ #define sqlite3_key_v2 SQLITE3MC_API_TABLE_MC->key_v2
15632
+ #define sqlite3_rekey SQLITE3MC_API_TABLE_MC->rekey
15633
+ #define sqlite3_rekey_v2 SQLITE3MC_API_TABLE_MC->rekey_v2
15634
+
15635
+ #define sqlite3mc_version SQLITE3MC_API_TABLE_MC->mc_version
15636
+ #define sqlite3mc_cipher_count SQLITE3MC_API_TABLE_MC->mc_cipher_count
15637
+ #define sqlite3mc_cipher_index SQLITE3MC_API_TABLE_MC->mc_cipher_index
15638
+ #define sqlite3mc_cipher_name SQLITE3MC_API_TABLE_MC->mc_cipher_name
15639
+ #define sqlite3mc_cipher_name_copy SQLITE3MC_API_TABLE_MC->mc_cipher_name_copy
15640
+ #define sqlite3mc_config SQLITE3MC_API_TABLE_MC->mc_config
15641
+ #define sqlite3mc_config_cipher SQLITE3MC_API_TABLE_MC->mc_config_cipher
15642
+ #define sqlite3mc_codec_data SQLITE3MC_API_TABLE_MC->mc_codec_data
15643
+
15644
+ #define sqlite3mc_vfs_create SQLITE3MC_API_TABLE_MC->mc_vfs_create
15645
+ #define sqlite3mc_vfs_destroy SQLITE3MC_API_TABLE_MC->mc_vfs_destroy
15646
+ #define sqlite3mc_vfs_shutdown SQLITE3MC_API_TABLE_MC->mc_vfs_shutdown
15647
+
15648
+ #endif /* !SQLITE_CORE */
15649
+
15650
+ #endif /* SQLITE3MC_USE_DISPATCH_TABLE */
15651
+
15652
+ #endif /* SQLITE3MC_H_ */