forked from arnetheduck/nim-sqlite3-abi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sqlite3_gen.nim
10099 lines (9876 loc) · 494 KB
/
sqlite3_gen.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Importing sqlite3.h
# Generated at 2021-01-10T20:51:10+02:00
# Command line:
# /home/yglukhov/.nimble/pkgs/nimterop-0.4.4/nimterop/toast --preprocess --pnim --symOverride=sqlite3_vmprintf,sqlite3_vsnprintf,sqlite3_str_vappendf,sqlite_int64,sqlite_uint64,sqlite3_int64,sqlite3_uint64 --nim:/home/yglukhov/Projects/nim-new/bin/nim --pluginSourcePath=/home/yglukhov/.cache/nim/nimterop/cPlugins/nimterop_93481909.nim sqlite3.h
{.hint[ConvFromXtoItselfNotNeeded]: off.}
const
headersqlite3 {.used.} = "sqlite3.h"
#
# ** 2001-09-15
# **
# ** The author disclaims copyright to this source code. In place of
# ** a legal notice, here is a blessing:
# **
# ** May you do good and not evil.
# ** May you find forgiveness for yourself and forgive others.
# ** May you share freely, never taking more than you give.
# **
# *************************************************************************
# ** This header file defines the interface that the SQLite library
# ** presents to client programs. If a C-function, structure, datatype,
# ** or constant definition does not appear in this file, then it is
# ** not a published API of SQLite, is subject to change without
# ** notice, and should not be referenced by programs that use SQLite.
# **
# ** Some of the definitions that are in this file are marked as
# ** "experimental". Experimental interfaces are normally new
# ** features recently added to SQLite. We do not anticipate changes
# ** to experimental interfaces but reserve the right to make minor changes
# ** if experience from use "in the wild" suggest such changes are prudent.
# **
# ** The official C-language API documentation for SQLite is derived
# ** from comments in this file. This file is the authoritative source
# ** on how SQLite interfaces are supposed to operate.
# **
# ** The name of this file under configuration management is "sqlite.h.in".
# ** The makefile makes some minor changes to this file (such as inserting
# ** the version number) and changes its name to "sqlite3.h" as
# ** part of the build process.
#
#
# ** Make sure we can call this stuff from C++.
#
#
# ** Provide the ability to override linkage features of the interface.
#
#
# ** These no-op macros are used in front of interfaces to mark those
# ** interfaces as either deprecated or experimental. New applications
# ** should not use deprecated interfaces - they are supported for backwards
# ** compatibility only. Application writers should be aware that
# ** experimental interfaces are subject to change in point releases.
# **
# ** These macros used to resolve to various kinds of compiler magic that
# ** would generate warning messages when they were used. But that
# ** compiler magic ended up generating such a flurry of bug reports
# ** that we have taken it all out and gone back to using simple
# ** noop macros.
#
#
# ** Ensure these symbols were not defined by some previous header file.
#
#
# ** CAPI3REF: Compile-Time Library Version Numbers
# **
# ** ^(The [SQLITE_VERSION] C preprocessor macro in the sqlite3.h header
# ** evaluates to a string literal that is the SQLite version in the
# ** format "X.Y.Z" where X is the major version number (always 3 for
# ** SQLite3) and Y is the minor version number and Z is the release number.)^
# ** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
# ** with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
# ** numbers used in [SQLITE_VERSION].)^
# ** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
# ** be larger than the release from which it is derived. Either Y will
# ** be held constant and Z will be incremented or else Y will be incremented
# ** and Z will be reset to zero.
# **
# ** Since [version 3.6.18] ([dateof:3.6.18]),
# ** SQLite source code has been stored in the
# ** <a href="http:www.fossil-scm.org/">Fossil configuration management
# ** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to
# ** a string which identifies a particular check-in of SQLite
# ** within its configuration management system. ^The SQLITE_SOURCE_ID
# ** string contains the date and time of the check-in (UTC) and a SHA1
# ** or SHA3-256 hash of the entire source tree. If the source code has
# ** been edited in any way since it was last checked in, then the last
# ** four hexadecimal digits of the hash may be modified.
# **
# ** See also: [sqlite3_libversion()],
# ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
# ** [sqlite_version()] and [sqlite_source_id()].
#
SQLITE_VERSION* = "3.34.0"
SQLITE_VERSION_NUMBER* = 3034000
SQLITE_SOURCE_ID* = "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
#
# ** CAPI3REF: Result Codes
# ** KEYWORDS: {result code definitions}
# **
# ** Many SQLite functions return an integer result code from the set shown
# ** here in order to indicate success or failure.
# **
# ** New error codes may be added in future versions of SQLite.
# **
# ** See also: [extended result code definitions]
#
SQLITE_OK* = 0
# beginning-of-error-codes
SQLITE_ERROR* = 1
SQLITE_INTERNAL* = 2
SQLITE_PERM* = 3
SQLITE_ABORT* = 4
SQLITE_BUSY* = 5
SQLITE_LOCKED* = 6
SQLITE_NOMEM* = 7
SQLITE_READONLY* = 8
SQLITE_INTERRUPT* = 9
SQLITE_IOERR* = 10
SQLITE_CORRUPT* = 11
SQLITE_NOTFOUND* = 12
SQLITE_FULL* = 13
SQLITE_CANTOPEN* = 14
SQLITE_PROTOCOL* = 15
SQLITE_EMPTY* = 16
SQLITE_SCHEMA* = 17
SQLITE_TOOBIG* = 18
SQLITE_CONSTRAINT* = 19
SQLITE_MISMATCH* = 20
SQLITE_MISUSE* = 21
SQLITE_NOLFS* = 22
SQLITE_AUTH* = 23
SQLITE_FORMAT* = 24
SQLITE_RANGE* = 25
SQLITE_NOTADB* = 26
SQLITE_NOTICE* = 27
SQLITE_WARNING* = 28
SQLITE_ROW* = 100
SQLITE_DONE* = 101
# end-of-error-codes
#
# ** CAPI3REF: Extended Result Codes
# ** KEYWORDS: {extended result code definitions}
# **
# ** In its default configuration, SQLite API routines return one of 30 integer
# ** [result codes]. However, experience has shown that many of
# ** these result codes are too coarse-grained. They do not provide as
# ** much information about problems as programmers might like. In an effort to
# ** address this, newer versions of SQLite (version 3.3.8 [dateof:3.3.8]
# ** and later) include
# ** support for additional result codes that provide more detailed information
# ** about errors. These [extended result codes] are enabled or disabled
# ** on a per database connection basis using the
# ** [sqlite3_extended_result_codes()] API. Or, the extended code for
# ** the most recent error can be obtained using
# ** [sqlite3_extended_errcode()].
#
#
# ** CAPI3REF: Flags For File Open Operations
# **
# ** These bit values are intended for use in the
# ** 3rd parameter to the [sqlite3_open_v2()] interface and
# ** in the 4th parameter to the [sqlite3_vfs.xOpen] method.
#
SQLITE_OPEN_READONLY* = 0x00000001
SQLITE_OPEN_READWRITE* = 0x00000002
SQLITE_OPEN_CREATE* = 0x00000004
SQLITE_OPEN_DELETEONCLOSE* = 0x00000008
SQLITE_OPEN_EXCLUSIVE* = 0x00000010
SQLITE_OPEN_AUTOPROXY* = 0x00000020
SQLITE_OPEN_URI* = 0x00000040
SQLITE_OPEN_MEMORY* = 0x00000080
SQLITE_OPEN_MAIN_DB* = 0x00000100
SQLITE_OPEN_TEMP_DB* = 0x00000200
SQLITE_OPEN_TRANSIENT_DB* = 0x00000400
SQLITE_OPEN_MAIN_JOURNAL* = 0x00000800
SQLITE_OPEN_TEMP_JOURNAL* = 0x00001000
SQLITE_OPEN_SUBJOURNAL* = 0x00002000
SQLITE_OPEN_SUPER_JOURNAL* = 0x00004000
SQLITE_OPEN_NOMUTEX* = 0x00008000
SQLITE_OPEN_FULLMUTEX* = 0x00010000
SQLITE_OPEN_SHAREDCACHE* = 0x00020000
SQLITE_OPEN_PRIVATECACHE* = 0x00040000
SQLITE_OPEN_WAL* = 0x00080000
SQLITE_OPEN_NOFOLLOW* = 0x01000000
# Reserved: 0x00F00000
# Legacy compatibility:
SQLITE_OPEN_MASTER_JOURNAL* = 0x00004000
#
# ** CAPI3REF: Device Characteristics
# **
# ** The xDeviceCharacteristics method of the [sqlite3_io_methods]
# ** object returns an integer which is a vector of these
# ** bit values expressing I/O characteristics of the mass storage
# ** device that holds the file that the [sqlite3_io_methods]
# ** refers to.
# **
# ** The SQLITE_IOCAP_ATOMIC property means that all writes of
# ** any size are atomic. The SQLITE_IOCAP_ATOMICnnn values
# ** mean that writes of blocks that are nnn bytes in size and
# ** are aligned to an address which is an integer multiple of
# ** nnn are atomic. The SQLITE_IOCAP_SAFE_APPEND value means
# ** that when data is appended to a file, the data is appended
# ** first then the size of the file is extended, never the other
# ** way around. The SQLITE_IOCAP_SEQUENTIAL property means that
# ** information is written to disk in the same order as calls
# ** to xWrite(). The SQLITE_IOCAP_POWERSAFE_OVERWRITE property means that
# ** after reboot following a crash or power loss, the only bytes in a
# ** file that were written at the application level might have changed
# ** and that adjacent bytes, even bytes within the same sector are
# ** guaranteed to be unchanged. The SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN
# ** flag indicates that a file cannot be deleted when open. The
# ** SQLITE_IOCAP_IMMUTABLE flag indicates that the file is on
# ** read-only media and cannot be changed even by processes with
# ** elevated privileges.
# **
# ** The SQLITE_IOCAP_BATCH_ATOMIC property means that the underlying
# ** filesystem supports doing multiple write operations atomically when those
# ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
# ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
#
SQLITE_IOCAP_ATOMIC* = 0x00000001
SQLITE_IOCAP_ATOMIC512* = 0x00000002
SQLITE_IOCAP_ATOMIC1K* = 0x00000004
SQLITE_IOCAP_ATOMIC2K* = 0x00000008
SQLITE_IOCAP_ATOMIC4K* = 0x00000010
SQLITE_IOCAP_ATOMIC8K* = 0x00000020
SQLITE_IOCAP_ATOMIC16K* = 0x00000040
SQLITE_IOCAP_ATOMIC32K* = 0x00000080
SQLITE_IOCAP_ATOMIC64K* = 0x00000100
SQLITE_IOCAP_SAFE_APPEND* = 0x00000200
SQLITE_IOCAP_SEQUENTIAL* = 0x00000400
SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN* = 0x00000800
SQLITE_IOCAP_POWERSAFE_OVERWRITE* = 0x00001000
SQLITE_IOCAP_IMMUTABLE* = 0x00002000
SQLITE_IOCAP_BATCH_ATOMIC* = 0x00004000
#
# ** CAPI3REF: File Locking Levels
# **
# ** SQLite uses one of these integer values as the second
# ** argument to calls it makes to the xLock() and xUnlock() methods
# ** of an [sqlite3_io_methods] object.
#
SQLITE_LOCK_NONE* = 0
SQLITE_LOCK_SHARED* = 1
SQLITE_LOCK_RESERVED* = 2
SQLITE_LOCK_PENDING* = 3
SQLITE_LOCK_EXCLUSIVE* = 4
#
# ** CAPI3REF: Synchronization Type Flags
# **
# ** When SQLite invokes the xSync() method of an
# ** [sqlite3_io_methods] object it uses a combination of
# ** these integer values as the second argument.
# **
# ** When the SQLITE_SYNC_DATAONLY flag is used, it means that the
# ** sync operation only needs to flush data to mass storage. Inode
# ** information need not be flushed. If the lower four bits of the flag
# ** equal SQLITE_SYNC_NORMAL, that means to use normal fsync() semantics.
# ** If the lower four bits equal SQLITE_SYNC_FULL, that means
# ** to use Mac OS X style fullsync instead of fsync().
# **
# ** Do not confuse the SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags
# ** with the [PRAGMA synchronous]=NORMAL and [PRAGMA synchronous]=FULL
# ** settings. The [synchronous pragma] determines when calls to the
# ** xSync VFS method occur and applies uniformly across all platforms.
# ** The SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL flags determine how
# ** energetic or rigorous or forceful the sync operations are and
# ** only make a difference on Mac OSX for the default SQLite code.
# ** (Third-party VFS implementations might also make the distinction
# ** between SQLITE_SYNC_NORMAL and SQLITE_SYNC_FULL, but among the
# ** operating systems natively supported by SQLite, only Mac OSX
# ** cares about the difference.)
#
SQLITE_SYNC_NORMAL* = 0x00002
SQLITE_SYNC_FULL* = 0x00003
SQLITE_SYNC_DATAONLY* = 0x00010
#
# ** CAPI3REF: Standard File Control Opcodes
# ** KEYWORDS: {file control opcodes} {file control opcode}
# **
# ** These integer constants are opcodes for the xFileControl method
# ** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()]
# ** interface.
# **
# ** <ul>
# ** <li>[[SQLITE_FCNTL_LOCKSTATE]]
# ** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This
# ** opcode causes the xFileControl method to write the current state of
# ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED],
# ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE])
# ** into an integer that the pArg argument points to. This capability
# ** is used during testing and is only available when the SQLITE_TEST
# ** compile-time option is used.
# **
# ** <li>[[SQLITE_FCNTL_SIZE_HINT]]
# ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS
# ** layer a hint of how large the database file will grow to be during the
# ** current transaction. This hint is not guaranteed to be accurate but it
# ** is often close. The underlying VFS might choose to preallocate database
# ** file space based on this hint in order to help writes to the database
# ** file run faster.
# **
# ** <li>[[SQLITE_FCNTL_SIZE_LIMIT]]
# ** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that
# ** implements [sqlite3_deserialize()] to set an upper bound on the size
# ** of the in-memory database. The argument is a pointer to a [sqlite3_int64].
# ** If the integer pointed to is negative, then it is filled in with the
# ** current limit. Otherwise the limit is set to the larger of the value
# ** of the integer pointed to and the current database size. The integer
# ** pointed to is set to the new limit.
# **
# ** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
# ** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
# ** extends and truncates the database file in chunks of a size specified
# ** by the user. The fourth argument to [sqlite3_file_control()] should
# ** point to an integer (type int) containing the new chunk-size to use
# ** for the nominated database. Allocating database file space in large
# ** chunks (say 1MB at a time), may reduce file-system fragmentation and
# ** improve performance on some systems.
# **
# ** <li>[[SQLITE_FCNTL_FILE_POINTER]]
# ** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer
# ** to the [sqlite3_file] object associated with a particular database
# ** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER].
# **
# ** <li>[[SQLITE_FCNTL_JOURNAL_POINTER]]
# ** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer
# ** to the [sqlite3_file] object associated with the journal file (either
# ** the [rollback journal] or the [write-ahead log]) for a particular database
# ** connection. See also [SQLITE_FCNTL_FILE_POINTER].
# **
# ** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
# ** No longer in use.
# **
# ** <li>[[SQLITE_FCNTL_SYNC]]
# ** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
# ** sent to the VFS immediately before the xSync method is invoked on a
# ** database file descriptor. Or, if the xSync method is not invoked
# ** because the user has configured SQLite with
# ** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place
# ** of the xSync method. In most cases, the pointer argument passed with
# ** this file-control is NULL. However, if the database file is being synced
# ** as part of a multi-database commit, the argument points to a nul-terminated
# ** string containing the transactions super-journal file name. VFSes that
# ** do not need this signal should silently ignore this opcode. Applications
# ** should not call [sqlite3_file_control()] with this opcode as doing so may
# ** disrupt the operation of the specialized VFSes that do require it.
# **
# ** <li>[[SQLITE_FCNTL_COMMIT_PHASETWO]]
# ** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite
# ** and sent to the VFS after a transaction has been committed immediately
# ** but before the database is unlocked. VFSes that do not need this signal
# ** should silently ignore this opcode. Applications should not call
# ** [sqlite3_file_control()] with this opcode as doing so may disrupt the
# ** operation of the specialized VFSes that do require it.
# **
# ** <li>[[SQLITE_FCNTL_WIN32_AV_RETRY]]
# ** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic
# ** retry counts and intervals for certain disk I/O operations for the
# ** windows [VFS] in order to provide robustness in the presence of
# ** anti-virus programs. By default, the windows VFS will retry file read,
# ** file write, and file delete operations up to 10 times, with a delay
# ** of 25 milliseconds before the first retry and with the delay increasing
# ** by an additional 25 milliseconds with each subsequent retry. This
# ** opcode allows these two values (10 retries and 25 milliseconds of delay)
# ** to be adjusted. The values are changed for all database connections
# ** within the same process. The argument is a pointer to an array of two
# ** integers where the first integer is the new retry count and the second
# ** integer is the delay. If either integer is negative, then the setting
# ** is not changed but instead the prior value of that setting is written
# ** into the array entry, allowing the current retry settings to be
# ** interrogated. The zDbName parameter is ignored.
# **
# ** <li>[[SQLITE_FCNTL_PERSIST_WAL]]
# ** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the
# ** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary
# ** write ahead log ([WAL file]) and shared memory
# ** files used for transaction control
# ** are automatically deleted when the latest connection to the database
# ** closes. Setting persistent WAL mode causes those files to persist after
# ** close. Persisting the files is useful when other processes that do not
# ** have write permission on the directory containing the database file want
# ** to read the database file, as the WAL and shared memory files must exist
# ** in order for the database to be readable. The fourth parameter to
# ** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
# ** That integer is 0 to disable persistent WAL mode or 1 to enable persistent
# ** WAL mode. If the integer is -1, then it is overwritten with the current
# ** WAL persistence setting.
# **
# ** <li>[[SQLITE_FCNTL_POWERSAFE_OVERWRITE]]
# ** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the
# ** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting
# ** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the
# ** xDeviceCharacteristics methods. The fourth parameter to
# ** [sqlite3_file_control()] for this opcode should be a pointer to an integer.
# ** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage
# ** mode. If the integer is -1, then it is overwritten with the current
# ** zero-damage mode setting.
# **
# ** <li>[[SQLITE_FCNTL_OVERWRITE]]
# ** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening
# ** a write transaction to indicate that, unless it is rolled back for some
# ** reason, the entire database file will be overwritten by the current
# ** transaction. This is used by VACUUM operations.
# **
# ** <li>[[SQLITE_FCNTL_VFSNAME]]
# ** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
# ** all [VFSes] in the VFS stack. The names are of all VFS shims and the
# ** final bottom-level VFS are written into memory obtained from
# ** [sqlite3_malloc()] and the result is stored in the char* variable
# ** that the fourth parameter of [sqlite3_file_control()] points to.
# ** The caller is responsible for freeing the memory when done. As with
# ** all file-control actions, there is no guarantee that this will actually
# ** do anything. Callers should initialize the char* variable to a NULL
# ** pointer in case this file-control is not implemented. This file-control
# ** is intended for diagnostic use only.
# **
# ** <li>[[SQLITE_FCNTL_VFS_POINTER]]
# ** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
# ** [VFSes] currently in use. ^(The argument X in
# ** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
# ** of type "[sqlite3_vfs] **". This opcodes will set *X
# ** to a pointer to the top-level VFS.)^
# ** ^When there are multiple VFS shims in the stack, this opcode finds the
# ** upper-most shim only.
# **
# ** <li>[[SQLITE_FCNTL_PRAGMA]]
# ** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA]
# ** file control is sent to the open [sqlite3_file] object corresponding
# ** to the database file to which the pragma statement refers. ^The argument
# ** to the [SQLITE_FCNTL_PRAGMA] file control is an array of
# ** pointers to strings (char**) in which the second element of the array
# ** is the name of the pragma and the third element is the argument to the
# ** pragma or NULL if the pragma has no argument. ^The handler for an
# ** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element
# ** of the char** argument point to a string obtained from [sqlite3_mprintf()]
# ** or the equivalent and that string will become the result of the pragma or
# ** the error message if the pragma fails. ^If the
# ** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal
# ** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA]
# ** file control returns [SQLITE_OK], then the parser assumes that the
# ** VFS has handled the PRAGMA itself and the parser generates a no-op
# ** prepared statement if result string is NULL, or that returns a copy
# ** of the result string if the string is non-NULL.
# ** ^If the [SQLITE_FCNTL_PRAGMA] file control returns
# ** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means
# ** that the VFS encountered an error while handling the [PRAGMA] and the
# ** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA]
# ** file control occurs at the beginning of pragma statement analysis and so
# ** it is able to override built-in [PRAGMA] statements.
# **
# ** <li>[[SQLITE_FCNTL_BUSYHANDLER]]
# ** ^The [SQLITE_FCNTL_BUSYHANDLER]
# ** file-control may be invoked by SQLite on the database file handle
# ** shortly after it is opened in order to provide a custom VFS with access
# ** to the connection's busy-handler callback. The argument is of type (void**)
# ** - an array of two (void *) values. The first (void *) actually points
# ** to a function of type (int (*)(void *)). In order to invoke the connection's
# ** busy-handler, this function should be invoked with the second (void *) in
# ** the array as the only argument. If it returns non-zero, then the operation
# ** should be retried. If it returns zero, the custom VFS should abandon the
# ** current operation.
# **
# ** <li>[[SQLITE_FCNTL_TEMPFILENAME]]
# ** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control
# ** to have SQLite generate a
# ** temporary filename using the same algorithm that is followed to generate
# ** temporary filenames for TEMP tables and other internal uses. The
# ** argument should be a char** which will be filled with the filename
# ** written into memory obtained from [sqlite3_malloc()]. The caller should
# ** invoke [sqlite3_free()] on the result to avoid a memory leak.
# **
# ** <li>[[SQLITE_FCNTL_MMAP_SIZE]]
# ** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the
# ** maximum number of bytes that will be used for memory-mapped I/O.
# ** The argument is a pointer to a value of type sqlite3_int64 that
# ** is an advisory maximum number of bytes in the file to memory map. The
# ** pointer is overwritten with the old value. The limit is not changed if
# ** the value originally pointed to is negative, and so the current limit
# ** can be queried by passing in a pointer to a negative number. This
# ** file-control is used internally to implement [PRAGMA mmap_size].
# **
# ** <li>[[SQLITE_FCNTL_TRACE]]
# ** The [SQLITE_FCNTL_TRACE] file control provides advisory information
# ** to the VFS about what the higher layers of the SQLite stack are doing.
# ** This file control is used by some VFS activity tracing [shims].
# ** The argument is a zero-terminated string. Higher layers in the
# ** SQLite stack may generate instances of this file control if
# ** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled.
# **
# ** <li>[[SQLITE_FCNTL_HAS_MOVED]]
# ** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a
# ** pointer to an integer and it writes a boolean into that integer depending
# ** on whether or not the file has been renamed, moved, or deleted since it
# ** was first opened.
# **
# ** <li>[[SQLITE_FCNTL_WIN32_GET_HANDLE]]
# ** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the
# ** underlying native file handle associated with a file handle. This file
# ** control interprets its argument as a pointer to a native file handle and
# ** writes the resulting value there.
# **
# ** <li>[[SQLITE_FCNTL_WIN32_SET_HANDLE]]
# ** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This
# ** opcode causes the xFileControl method to swap the file handle with the one
# ** pointed to by the pArg argument. This capability is used during testing
# ** and only needs to be supported when SQLITE_TEST is defined.
# **
# ** <li>[[SQLITE_FCNTL_WAL_BLOCK]]
# ** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might
# ** be advantageous to block on the next WAL lock if the lock is not immediately
# ** available. The WAL subsystem issues this signal during rare
# ** circumstances in order to fix a problem with priority inversion.
# ** Applications should <em>not</em> use this file-control.
# **
# ** <li>[[SQLITE_FCNTL_ZIPVFS]]
# ** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other
# ** VFS should return SQLITE_NOTFOUND for this opcode.
# **
# ** <li>[[SQLITE_FCNTL_RBU]]
# ** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by
# ** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for
# ** this opcode.
# **
# ** <li>[[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]]
# ** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then
# ** the file descriptor is placed in "batch write mode", which
# ** means all subsequent write operations will be deferred and done
# ** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems
# ** that do not support batch atomic writes will return SQLITE_NOTFOUND.
# ** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to
# ** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or
# ** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make
# ** no VFS interface calls on the same [sqlite3_file] file descriptor
# ** except for calls to the xWrite method and the xFileControl method
# ** with [SQLITE_FCNTL_SIZE_HINT].
# **
# ** <li>[[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]]
# ** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write
# ** operations since the previous successful call to
# ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically.
# ** This file control returns [SQLITE_OK] if and only if the writes were
# ** all performed successfully and have been committed to persistent storage.
# ** ^Regardless of whether or not it is successful, this file control takes
# ** the file descriptor out of batch write mode so that all subsequent
# ** write operations are independent.
# ** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without
# ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
# **
# ** <li>[[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]]
# ** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write
# ** operations since the previous successful call to
# ** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back.
# ** ^This file control takes the file descriptor out of batch write mode
# ** so that all subsequent write operations are independent.
# ** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without
# ** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE].
# **
# ** <li>[[SQLITE_FCNTL_LOCK_TIMEOUT]]
# ** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS
# ** to block for up to M milliseconds before failing when attempting to
# ** obtain a file lock using the xLock or xShmLock methods of the VFS.
# ** The parameter is a pointer to a 32-bit signed integer that contains
# ** the value that M is to be set to. Before returning, the 32-bit signed
# ** integer is overwritten with the previous value of M.
# **
# ** <li>[[SQLITE_FCNTL_DATA_VERSION]]
# ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
# ** a database file. The argument is a pointer to a 32-bit unsigned integer.
# ** The "data version" for the pager is written into the pointer. The
# ** "data version" changes whenever any change occurs to the corresponding
# ** database file, either through SQL statements on the same database
# ** connection or through transactions committed by separate database
# ** connections possibly in other processes. The [sqlite3_total_changes()]
# ** interface can be used to find if any database on the connection has changed,
# ** but that interface responds to changes on TEMP as well as MAIN and does
# ** not provide a mechanism to detect changes to MAIN only. Also, the
# ** [sqlite3_total_changes()] interface responds to internal changes only and
# ** omits changes made by other database connections. The
# ** [PRAGMA data_version] command provides a mechanism to detect changes to
# ** a single attached database that occur due to other database connections,
# ** but omits changes implemented by the database connection on which it is
# ** called. This file control is the only mechanism to detect changes that
# ** happen either internally or externally and that are associated with
# ** a particular attached database.
# **
# ** <li>[[SQLITE_FCNTL_CKPT_START]]
# ** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint
# ** in wal mode before the client starts to copy pages from the wal
# ** file to the database file.
# **
# ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
# ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
# ** in wal mode after the client has finished copying pages from the wal
# ** file to the database file, but before the *-shm file is updated to
# ** record the fact that the pages have been checkpointed.
# ** </ul>
#
SQLITE_FCNTL_LOCKSTATE* = 1
SQLITE_FCNTL_GET_LOCKPROXYFILE* = 2
SQLITE_FCNTL_SET_LOCKPROXYFILE* = 3
SQLITE_FCNTL_LAST_ERRNO* = 4
SQLITE_FCNTL_SIZE_HINT* = 5
SQLITE_FCNTL_CHUNK_SIZE* = 6
SQLITE_FCNTL_FILE_POINTER* = 7
SQLITE_FCNTL_SYNC_OMITTED* = 8
SQLITE_FCNTL_WIN32_AV_RETRY* = 9
SQLITE_FCNTL_PERSIST_WAL* = 10
SQLITE_FCNTL_OVERWRITE* = 11
SQLITE_FCNTL_VFSNAME* = 12
SQLITE_FCNTL_POWERSAFE_OVERWRITE* = 13
SQLITE_FCNTL_PRAGMA* = 14
SQLITE_FCNTL_BUSYHANDLER* = 15
SQLITE_FCNTL_TEMPFILENAME* = 16
SQLITE_FCNTL_MMAP_SIZE* = 18
SQLITE_FCNTL_TRACE* = 19
SQLITE_FCNTL_HAS_MOVED* = 20
SQLITE_FCNTL_SYNC* = 21
SQLITE_FCNTL_COMMIT_PHASETWO* = 22
SQLITE_FCNTL_WIN32_SET_HANDLE* = 23
SQLITE_FCNTL_WAL_BLOCK* = 24
SQLITE_FCNTL_ZIPVFS* = 25
SQLITE_FCNTL_RBU* = 26
SQLITE_FCNTL_VFS_POINTER* = 27
SQLITE_FCNTL_JOURNAL_POINTER* = 28
SQLITE_FCNTL_WIN32_GET_HANDLE* = 29
SQLITE_FCNTL_PDB* = 30
SQLITE_FCNTL_BEGIN_ATOMIC_WRITE* = 31
SQLITE_FCNTL_COMMIT_ATOMIC_WRITE* = 32
SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE* = 33
SQLITE_FCNTL_LOCK_TIMEOUT* = 34
SQLITE_FCNTL_DATA_VERSION* = 35
SQLITE_FCNTL_SIZE_LIMIT* = 36
SQLITE_FCNTL_CKPT_DONE* = 37
SQLITE_FCNTL_RESERVE_BYTES* = 38
SQLITE_FCNTL_CKPT_START* = 39
#
# ** CAPI3REF: Flags for the xAccess VFS method
# **
# ** These integer constants can be used as the third parameter to
# ** the xAccess method of an [sqlite3_vfs] object. They determine
# ** what kind of permissions the xAccess method is looking for.
# ** With SQLITE_ACCESS_EXISTS, the xAccess method
# ** simply checks whether the file exists.
# ** With SQLITE_ACCESS_READWRITE, the xAccess method
# ** checks whether the named directory is both readable and writable
# ** (in other words, if files can be added, removed, and renamed within
# ** the directory).
# ** The SQLITE_ACCESS_READWRITE constant is currently used only by the
# ** [temp_store_directory pragma], though this could change in a future
# ** release of SQLite.
# ** With SQLITE_ACCESS_READ, the xAccess method
# ** checks whether the file is readable. The SQLITE_ACCESS_READ constant is
# ** currently unused, though it might be used in a future release of
# ** SQLite.
#
SQLITE_ACCESS_EXISTS* = 0
SQLITE_ACCESS_READWRITE* = 1
SQLITE_ACCESS_READ* = 2
#
# ** CAPI3REF: Flags for the xShmLock VFS method
# **
# ** These integer constants define the various locking operations
# ** allowed by the xShmLock method of [sqlite3_io_methods]. The
# ** following are the only legal combinations of flags to the
# ** xShmLock method:
# **
# ** <ul>
# ** <li> SQLITE_SHM_LOCK | SQLITE_SHM_SHARED
# ** <li> SQLITE_SHM_LOCK | SQLITE_SHM_EXCLUSIVE
# ** <li> SQLITE_SHM_UNLOCK | SQLITE_SHM_SHARED
# ** <li> SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE
# ** </ul>
# **
# ** When unlocking, the same SHARED or EXCLUSIVE flag must be supplied as
# ** was given on the corresponding lock.
# **
# ** The xShmLock method can transition between unlocked and SHARED or
# ** between unlocked and EXCLUSIVE. It cannot transition between SHARED
# ** and EXCLUSIVE.
#
SQLITE_SHM_UNLOCK* = 1
SQLITE_SHM_LOCK* = 2
SQLITE_SHM_SHARED* = 4
SQLITE_SHM_EXCLUSIVE* = 8
#
# ** CAPI3REF: Maximum xShmLock index
# **
# ** The xShmLock method on [sqlite3_io_methods] may use values
# ** between 0 and this upper bound as its "offset" argument.
# ** The SQLite core will never attempt to acquire or release a
# ** lock outside of this range
#
SQLITE_SHM_NLOCK* = 8
#
# ** CAPI3REF: Configuration Options
# ** KEYWORDS: {configuration option}
# **
# ** These constants are the available integer configuration options that
# ** can be passed as the first argument to the [sqlite3_config()] interface.
# **
# ** New configuration options may be added in future releases of SQLite.
# ** Existing configuration options might be discontinued. Applications
# ** should check the return code from [sqlite3_config()] to make sure that
# ** the call worked. The [sqlite3_config()] interface will return a
# ** non-zero [error code] if a discontinued or unsupported configuration option
# ** is invoked.
# **
# ** <dl>
# ** [[SQLITE_CONFIG_SINGLETHREAD]] <dt>SQLITE_CONFIG_SINGLETHREAD</dt>
# ** <dd>There are no arguments to this option. ^This option sets the
# ** [threading mode] to Single-thread. In other words, it disables
# ** all mutexing and puts SQLite into a mode where it can only be used
# ** by a single thread. ^If SQLite is compiled with
# ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
# ** it is not possible to change the [threading mode] from its default
# ** value of Single-thread and so [sqlite3_config()] will return
# ** [SQLITE_ERROR] if called with the SQLITE_CONFIG_SINGLETHREAD
# ** configuration option.</dd>
# **
# ** [[SQLITE_CONFIG_MULTITHREAD]] <dt>SQLITE_CONFIG_MULTITHREAD</dt>
# ** <dd>There are no arguments to this option. ^This option sets the
# ** [threading mode] to Multi-thread. In other words, it disables
# ** mutexing on [database connection] and [prepared statement] objects.
# ** The application is responsible for serializing access to
# ** [database connections] and [prepared statements]. But other mutexes
# ** are enabled so that SQLite will be safe to use in a multi-threaded
# ** environment as long as no two threads attempt to use the same
# ** [database connection] at the same time. ^If SQLite is compiled with
# ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
# ** it is not possible to set the Multi-thread [threading mode] and
# ** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
# ** SQLITE_CONFIG_MULTITHREAD configuration option.</dd>
# **
# ** [[SQLITE_CONFIG_SERIALIZED]] <dt>SQLITE_CONFIG_SERIALIZED</dt>
# ** <dd>There are no arguments to this option. ^This option sets the
# ** [threading mode] to Serialized. In other words, this option enables
# ** all mutexes including the recursive
# ** mutexes on [database connection] and [prepared statement] objects.
# ** In this mode (which is the default when SQLite is compiled with
# ** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
# ** to [database connections] and [prepared statements] so that the
# ** application is free to use the same [database connection] or the
# ** same [prepared statement] in different threads at the same time.
# ** ^If SQLite is compiled with
# ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
# ** it is not possible to set the Serialized [threading mode] and
# ** [sqlite3_config()] will return [SQLITE_ERROR] if called with the
# ** SQLITE_CONFIG_SERIALIZED configuration option.</dd>
# **
# ** [[SQLITE_CONFIG_MALLOC]] <dt>SQLITE_CONFIG_MALLOC</dt>
# ** <dd> ^(The SQLITE_CONFIG_MALLOC option takes a single argument which is
# ** a pointer to an instance of the [sqlite3_mem_methods] structure.
# ** The argument specifies
# ** alternative low-level memory allocation routines to be used in place of
# ** the memory allocation routines built into SQLite.)^ ^SQLite makes
# ** its own private copy of the content of the [sqlite3_mem_methods] structure
# ** before the [sqlite3_config()] call returns.</dd>
# **
# ** [[SQLITE_CONFIG_GETMALLOC]] <dt>SQLITE_CONFIG_GETMALLOC</dt>
# ** <dd> ^(The SQLITE_CONFIG_GETMALLOC option takes a single argument which
# ** is a pointer to an instance of the [sqlite3_mem_methods] structure.
# ** The [sqlite3_mem_methods]
# ** structure is filled with the currently defined memory allocation routines.)^
# ** This option can be used to overload the default memory allocation
# ** routines with a wrapper that simulations memory allocation failure or
# ** tracks memory usage, for example. </dd>
# **
# ** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
# ** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
# ** type int, interpreted as a boolean, which if true provides a hint to
# ** SQLite that it should avoid large memory allocations if possible.
# ** SQLite will run faster if it is free to make large memory allocations,
# ** but some application might prefer to run slower in exchange for
# ** guarantees about memory fragmentation that are possible if large
# ** allocations are avoided. This hint is normally off.
# ** </dd>
# **
# ** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
# ** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
# ** interpreted as a boolean, which enables or disables the collection of
# ** memory allocation statistics. ^(When memory allocation statistics are
# ** disabled, the following SQLite interfaces become non-operational:
# ** <ul>
# ** <li> [sqlite3_hard_heap_limit64()]
# ** <li> [sqlite3_memory_used()]
# ** <li> [sqlite3_memory_highwater()]
# ** <li> [sqlite3_soft_heap_limit64()]
# ** <li> [sqlite3_status64()]
# ** </ul>)^
# ** ^Memory allocation statistics are enabled by default unless SQLite is
# ** compiled with [SQLITE_DEFAULT_MEMSTATUS]=0 in which case memory
# ** allocation statistics are disabled by default.
# ** </dd>
# **
# ** [[SQLITE_CONFIG_SCRATCH]] <dt>SQLITE_CONFIG_SCRATCH</dt>
# ** <dd> The SQLITE_CONFIG_SCRATCH option is no longer used.
# ** </dd>
# **
# ** [[SQLITE_CONFIG_PAGECACHE]] <dt>SQLITE_CONFIG_PAGECACHE</dt>
# ** <dd> ^The SQLITE_CONFIG_PAGECACHE option specifies a memory pool
# ** that SQLite can use for the database page cache with the default page
# ** cache implementation.
# ** This configuration option is a no-op if an application-defined page
# ** cache implementation is loaded using the [SQLITE_CONFIG_PCACHE2].
# ** ^There are three arguments to SQLITE_CONFIG_PAGECACHE: A pointer to
# ** 8-byte aligned memory (pMem), the size of each page cache line (sz),
# ** and the number of cache lines (N).
# ** The sz argument should be the size of the largest database page
# ** (a power of two between 512 and 65536) plus some extra bytes for each
# ** page header. ^The number of extra bytes needed by the page header
# ** can be determined using [SQLITE_CONFIG_PCACHE_HDRSZ].
# ** ^It is harmless, apart from the wasted memory,
# ** for the sz parameter to be larger than necessary. The pMem
# ** argument must be either a NULL pointer or a pointer to an 8-byte
# ** aligned block of memory of at least sz*N bytes, otherwise
# ** subsequent behavior is undefined.
# ** ^When pMem is not NULL, SQLite will strive to use the memory provided
# ** to satisfy page cache needs, falling back to [sqlite3_malloc()] if
# ** a page cache line is larger than sz bytes or if all of the pMem buffer
# ** is exhausted.
# ** ^If pMem is NULL and N is non-zero, then each database connection
# ** does an initial bulk allocation for page cache memory
# ** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
# ** of -1024*N bytes if N is negative, . ^If additional
# ** page cache memory is needed beyond what is provided by the initial
# ** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
# ** additional cache line. </dd>
# **
# ** [[SQLITE_CONFIG_HEAP]] <dt>SQLITE_CONFIG_HEAP</dt>
# ** <dd> ^The SQLITE_CONFIG_HEAP option specifies a static memory buffer
# ** that SQLite will use for all of its dynamic memory allocation needs
# ** beyond those provided for by [SQLITE_CONFIG_PAGECACHE].
# ** ^The SQLITE_CONFIG_HEAP option is only available if SQLite is compiled
# ** with either [SQLITE_ENABLE_MEMSYS3] or [SQLITE_ENABLE_MEMSYS5] and returns
# ** [SQLITE_ERROR] if invoked otherwise.
# ** ^There are three arguments to SQLITE_CONFIG_HEAP:
# ** An 8-byte aligned pointer to the memory,
# ** the number of bytes in the memory buffer, and the minimum allocation size.
# ** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
# ** to using its default memory allocator (the system malloc() implementation),
# ** undoing any prior invocation of [SQLITE_CONFIG_MALLOC]. ^If the
# ** memory pointer is not NULL then the alternative memory
# ** allocator is engaged to handle all of SQLites memory allocation needs.
# ** The first pointer (the memory pointer) must be aligned to an 8-byte
# ** boundary or subsequent behavior of SQLite will be undefined.
# ** The minimum allocation size is capped at 2**12. Reasonable values
# ** for the minimum allocation size are 2**5 through 2**8.</dd>
# **
# ** [[SQLITE_CONFIG_MUTEX]] <dt>SQLITE_CONFIG_MUTEX</dt>
# ** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
# ** pointer to an instance of the [sqlite3_mutex_methods] structure.
# ** The argument specifies alternative low-level mutex routines to be used
# ** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
# ** the content of the [sqlite3_mutex_methods] structure before the call to
# ** [sqlite3_config()] returns. ^If SQLite is compiled with
# ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
# ** the entire mutexing subsystem is omitted from the build and hence calls to
# ** [sqlite3_config()] with the SQLITE_CONFIG_MUTEX configuration option will
# ** return [SQLITE_ERROR].</dd>
# **
# ** [[SQLITE_CONFIG_GETMUTEX]] <dt>SQLITE_CONFIG_GETMUTEX</dt>
# ** <dd> ^(The SQLITE_CONFIG_GETMUTEX option takes a single argument which
# ** is a pointer to an instance of the [sqlite3_mutex_methods] structure. The
# ** [sqlite3_mutex_methods]
# ** structure is filled with the currently defined mutex routines.)^
# ** This option can be used to overload the default mutex allocation
# ** routines with a wrapper used to track mutex usage for performance
# ** profiling or testing, for example. ^If SQLite is compiled with
# ** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
# ** the entire mutexing subsystem is omitted from the build and hence calls to
# ** [sqlite3_config()] with the SQLITE_CONFIG_GETMUTEX configuration option will
# ** return [SQLITE_ERROR].</dd>
# **
# ** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
# ** <dd> ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine
# ** the default size of lookaside memory on each [database connection].
# ** The first argument is the
# ** size of each lookaside buffer slot and the second is the number of
# ** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE
# ** sets the <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
# ** option to [sqlite3_db_config()] can be used to change the lookaside
# ** configuration on individual connections.)^ </dd>
# **
# ** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
# ** <dd> ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is
# ** a pointer to an [sqlite3_pcache_methods2] object. This object specifies
# ** the interface to a custom page cache implementation.)^
# ** ^SQLite makes a copy of the [sqlite3_pcache_methods2] object.</dd>
# **
# ** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
# ** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
# ** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies of
# ** the current page cache implementation into that object.)^ </dd>
# **
# ** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
# ** <dd> The SQLITE_CONFIG_LOG option is used to configure the SQLite
# ** global [error log].
# ** (^The SQLITE_CONFIG_LOG option takes two arguments: a pointer to a
# ** function with a call signature of void(*)(void*,int,const char*),
# ** and a pointer to void. ^If the function pointer is not NULL, it is
# ** invoked by [sqlite3_log()] to process each logging event. ^If the
# ** function pointer is NULL, the [sqlite3_log()] interface becomes a no-op.
# ** ^The void pointer that is the second argument to SQLITE_CONFIG_LOG is
# ** passed through as the first parameter to the application-defined logger
# ** function whenever that function is invoked. ^The second parameter to
# ** the logger function is a copy of the first parameter to the corresponding
# ** [sqlite3_log()] call and is intended to be a [result code] or an
# ** [extended result code]. ^The third parameter passed to the logger is
# ** log message after formatting via [sqlite3_snprintf()].
# ** The SQLite logging interface is not reentrant; the logger function
# ** supplied by the application must not invoke any SQLite interface.
# ** In a multi-threaded application, the application-defined logger
# ** function must be threadsafe. </dd>
# **
# ** [[SQLITE_CONFIG_URI]] <dt>SQLITE_CONFIG_URI
# ** <dd>^(The SQLITE_CONFIG_URI option takes a single argument of type int.
# ** If non-zero, then URI handling is globally enabled. If the parameter is zero,
# ** then URI handling is globally disabled.)^ ^If URI handling is globally
# ** enabled, all filenames passed to [sqlite3_open()], [sqlite3_open_v2()],
# ** [sqlite3_open16()] or
# ** specified as part of [ATTACH] commands are interpreted as URIs, regardless
# ** of whether or not the [SQLITE_OPEN_URI] flag is set when the database
# ** connection is opened. ^If it is globally disabled, filenames are
# ** only interpreted as URIs if the SQLITE_OPEN_URI flag is set when the
# ** database connection is opened. ^(By default, URI handling is globally
# ** disabled. The default value may be changed by compiling with the
# ** [SQLITE_USE_URI] symbol defined.)^
# **
# ** [[SQLITE_CONFIG_COVERING_INDEX_SCAN]] <dt>SQLITE_CONFIG_COVERING_INDEX_SCAN
# ** <dd>^The SQLITE_CONFIG_COVERING_INDEX_SCAN option takes a single integer
# ** argument which is interpreted as a boolean in order to enable or disable
# ** the use of covering indices for full table scans in the query optimizer.
# ** ^The default setting is determined
# ** by the [SQLITE_ALLOW_COVERING_INDEX_SCAN] compile-time option, or is "on"
# ** if that compile-time option is omitted.
# ** The ability to disable the use of covering indices for full table scans
# ** is because some incorrectly coded legacy applications might malfunction
# ** when the optimization is enabled. Providing the ability to
# ** disable the optimization allows the older, buggy application code to work
# ** without change even with newer versions of SQLite.
# **
# ** [[SQLITE_CONFIG_PCACHE]] [[SQLITE_CONFIG_GETPCACHE]]
# ** <dt>SQLITE_CONFIG_PCACHE and SQLITE_CONFIG_GETPCACHE
# ** <dd> These options are obsolete and should not be used by new code.
# ** They are retained for backwards compatibility but are now no-ops.
# ** </dd>
# **
# ** [[SQLITE_CONFIG_SQLLOG]]
# ** <dt>SQLITE_CONFIG_SQLLOG
# ** <dd>This option is only available if sqlite is compiled with the
# ** [SQLITE_ENABLE_SQLLOG] pre-processor macro defined. The first argument should
# ** be a pointer to a function of type void(*)(void*,sqlite3*,const char*, int).
# ** The second should be of type (void*). The callback is invoked by the library
# ** in three separate circumstances, identified by the value passed as the
# ** fourth parameter. If the fourth parameter is 0, then the database connection
# ** passed as the second argument has just been opened. The third argument
# ** points to a buffer containing the name of the main database file. If the
# ** fourth parameter is 1, then the SQL statement that the third parameter
# ** points to has just been executed. Or, if the fourth parameter is 2, then
# ** the connection being passed as the second parameter is being closed. The
# ** third parameter is passed NULL In this case. An example of using this
# ** configuration option can be seen in the "test_sqllog.c" source file in
# ** the canonical SQLite source tree.</dd>
# **
# ** [[SQLITE_CONFIG_MMAP_SIZE]]
# ** <dt>SQLITE_CONFIG_MMAP_SIZE
# ** <dd>^SQLITE_CONFIG_MMAP_SIZE takes two 64-bit integer (sqlite3_int64) values
# ** that are the default mmap size limit (the default setting for
# ** [PRAGMA mmap_size]) and the maximum allowed mmap size limit.
# ** ^The default setting can be overridden by each database connection using
# ** either the [PRAGMA mmap_size] command, or by using the
# ** [SQLITE_FCNTL_MMAP_SIZE] file control. ^(The maximum allowed mmap size
# ** will be silently truncated if necessary so that it does not exceed the
# ** compile-time maximum mmap size set by the
# ** [SQLITE_MAX_MMAP_SIZE] compile-time option.)^
# ** ^If either argument to this option is negative, then that argument is
# ** changed to its compile-time default.
# **
# ** [[SQLITE_CONFIG_WIN32_HEAPSIZE]]
# ** <dt>SQLITE_CONFIG_WIN32_HEAPSIZE
# ** <dd>^The SQLITE_CONFIG_WIN32_HEAPSIZE option is only available if SQLite is
# ** compiled for Windows with the [SQLITE_WIN32_MALLOC] pre-processor macro
# ** defined. ^SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit unsigned integer value