summaryrefslogtreecommitdiff
path: root/src/include/wiredtiger.in
blob: b8af07f2beea9d852c5257192f5aa59efcbe762e (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
/*-
 * Copyright (c) 2008-2012 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

#ifndef	__WIREDTIGER_H_
#define	__WIREDTIGER_H_

#if defined(__cplusplus)
extern "C" {
#endif

/*******************************************
 * Version information
 *******************************************/
#define	WIREDTIGER_VERSION_MAJOR	@VERSION_MAJOR@
#define	WIREDTIGER_VERSION_MINOR	@VERSION_MINOR@
#define	WIREDTIGER_VERSION_PATCH	@VERSION_PATCH@
#define	WIREDTIGER_VERSION_STRING	@VERSION_STRING@

/*******************************************
 * Required includes
 *******************************************/
@wiredtiger_includes_decl@

/*******************************************
 * Portable type names
 *******************************************/
@int8_decl@
@u_int8_decl@
@int16_decl@
@u_int16_decl@
@int32_decl@
@u_int32_decl@
@int64_decl@
@u_int64_decl@

@u_char_decl@
@u_short_decl@
@u_int_decl@
@u_long_decl@
@u_quad_decl@

@uintmax_t_decl@
@uintptr_t_decl@

#if defined(DOXYGEN) || defined(SWIG)
#define	__F(func) func
#else
#define	__F(func) (*func)
#endif

#ifdef SWIG
%{
#include <wiredtiger.h>
%}
#endif

/*! @defgroup wt WiredTiger API
 * The functions, handles and methods applications use to access and manage
 * data with WiredTiger.
 *
 * @{
 */

/*******************************************
 * Public forward structure declarations
 *******************************************/
struct __wt_collator;	    typedef struct __wt_collator WT_COLLATOR;
struct __wt_compressor;	    typedef struct __wt_compressor WT_COMPRESSOR;
struct __wt_connection;	    typedef struct __wt_connection WT_CONNECTION;
struct __wt_cursor;	    typedef struct __wt_cursor WT_CURSOR;
struct __wt_data_source;    typedef struct __wt_data_source WT_DATA_SOURCE;
struct __wt_event_handler;  typedef struct __wt_event_handler WT_EVENT_HANDLER;
struct __wt_extension_api;  typedef struct __wt_extension_api WT_EXTENSION_API;
struct __wt_extractor;	    typedef struct __wt_extractor WT_EXTRACTOR;
struct __wt_item;	    typedef struct __wt_item WT_ITEM;
struct __wt_session;	    typedef struct __wt_session WT_SESSION;

/*!
 * A raw item of data to be managed.  Data items have a pointer to the data and
 * a length (limited to 4GB for items stored in tables).
 */
struct __wt_item {
	/*!
	 * The memory reference of the data item.
	 *
	 * For items returned by a WT_CURSOR, the pointer is only valid until
	 * the next operation on that cursor.  Applications that need to keep
	 * an item across multiple cursor operations must make a copy.
	 */
	const void *data;

	/*!
	 * The number of bytes in the data item.
	 */
	uint32_t size;

#ifndef DOXYGEN
#define	WT_ITEM_ALIGNED					0x00000001
#define	WT_ITEM_INUSE					0x00000002
	/* This appears in the middle of the struct to avoid padding. */
	/*! Object flags (internal use). */
	uint32_t flags;

	/*! Managed memory chunk (internal use). */
	void *mem;
	/*! Managed memory size (internal use). */
	size_t memsize;
#endif
};

/*!
 * The maximum packed size of a 64-bit integer.  The ::wiredtiger_struct_pack
 * function will pack single long integers into at most this many bytes.
 */
#define	WT_INTPACK64_MAXSIZE	((int)sizeof (int64_t) + 1)

/*!
 * The maximum packed size of a 32-bit integer.  The ::wiredtiger_struct_pack
 * function will pack single integers into at most this many bytes.
 */
#define	WT_INTPACK32_MAXSIZE	((int)sizeof (int32_t) + 1)

/*!
 * A WT_CURSOR handle is the interface to a cursor.
 *
 * Cursors allow data to be searched, iterated and modified, implementing the
 * CRUD (create, read, update and delete) operations.  Cursors are opened in
 * the context of a session.  If a transaction is started, cursors operate in
 * the context of the transaction until the transaction is resolved.
 *
 * Raw data is represented by key/value pairs of WT_ITEM structures, but
 * cursors can also provide access to fields within the key and value if the
 * formats are described in the WT_SESSION::create method.
 *
 * In the common case, a cursor is used to access records in a table.  However,
 * cursors can be used on subsets of tables (such as a single column or a
 * projection of multiple columns), as an interface to statistics, configuration
 * data or application-specific data sources.  See WT_SESSION::open_cursor for
 * more information.
 *
 * <b>Thread safety:</b> A WT_CURSOR handle is not usually shared between
 * threads, see @ref threads for more information.
 */
struct __wt_cursor {
	WT_SESSION *session;	/*!< The session handle for this cursor. */

	/*!
	 * The name of the data source for the cursor, matches the \c uri
	 * parameter to WT_SESSION::open_cursor used to open the cursor.
	 */
	const char *uri;

	/*!
	 * The format of the data packed into key items.  See @ref packing for
	 * details.  If not set, a default value of "u" is assumed, and
	 * applications must use WT_ITEM structures to manipulate untyped byte
	 * arrays.
	 */
	const char *key_format;

	/*!
	 * The format of the data packed into value items.  See @ref packing
	 * for details.  If not set, a default value of "u" is assumed, and
	 * applications must use WT_ITEM structures to manipulate untyped byte
	 * arrays.
	 */
	const char *value_format;

	/*! @name Data access
	 * @{
	 */
	/*! Get the key for the current record.
	 *
	 * @snippet ex_all.c Get the cursor's string key
	 *
	 * @snippet ex_all.c Get the cursor's record number key
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(get_key)(WT_CURSOR *cursor, ...);

	/*! Get the value for the current record.
	 *
	 * @snippet ex_all.c Get the cursor's string value
	 *
	 * @snippet ex_all.c Get the cursor's raw value
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(get_value)(WT_CURSOR *cursor, ...);

	/*! Set the key for the next operation.
	 *
	 * @snippet ex_all.c Set the cursor's string key
	 *
	 * @snippet ex_all.c Set the cursor's record number key
	 *
	 * @param cursor the cursor handle
	 *
	 * If an error occurs during this operation, a flag will be set in the
	 * cursor, and the next operation to access the key will fail.  This
	 * simplifies error handling in applications.
	 */
	void __F(set_key)(WT_CURSOR *cursor, ...);

	/*! Set the value for the next operation.
	 *
	 * @snippet ex_all.c Set the cursor's string value
	 *
	 * @snippet ex_all.c Set the cursor's raw value
	 *
	 * @param cursor the cursor handle
	 *
	 * If an error occurs during this operation, a flag will be set in the
	 * cursor, and the next operation to access the value will fail.  This
	 * simplifies error handling in applications.
	 */
	void __F(set_value)(WT_CURSOR *cursor, ...);
	/*! @} */

	/*! @name Cursor positioning
	 * @{
	 */
	/*! Return the ordering relationship between two cursors: both cursors
	 * must have the same data source and have valid keys.
	 *
	 * @snippet ex_all.c Cursor comparison
	 *
	 * @param cursor the cursor handle
	 * @param other another cursor handle
	 * @param comparep the status of the comparison: < 0 if
	 * <code>cursor</code> refers to a key that appears before
	 * <code>other</code>, 0 if the cursors refer to the same key,
	 * and > 0 if <code>cursor</code> refers to a key that appears after
	 * <code>other</code>.
	 * @errors
	 */
	int __F(compare)(WT_CURSOR *cursor, WT_CURSOR *other, int *comparep);

	/*! Return the next record.
	 *
	 * @snippet ex_all.c Return the next record
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(next)(WT_CURSOR *cursor);

	/*! Return the previous record.
	 *
	 * @snippet ex_all.c Return the previous record
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(prev)(WT_CURSOR *cursor);

	/*! Reset the position of the cursor.  Any resources held by the cursor
	 * are released, and the cursor's key and position are no longer valid.
	 * A subsequent iteration with WT_CURSOR::next will move to the first
	 * record, or with WT_CURSOR::prev will move to the last record.
	 *
	 * @snippet ex_all.c Reset the cursor
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(reset)(WT_CURSOR *cursor);

	/*! Move to the record matching the key. The key must first be set.
	 *
	 * @snippet ex_all.c Search for an exact match
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(search)(WT_CURSOR *cursor);

	/*! Move to the record matching the key if it exists, or a record that
	 * would be adjacent.  Either the smallest record larger than the key
	 * or the largest record smaller than the key (in other words, a
	 * logically adjacent key).  The key must first be set.
	 *
	 * @snippet ex_all.c Search for an exact or adjacent match
	 *
	 * @snippet ex_all.c Forward scan greater than or equal
	 *
	 * @snippet ex_all.c Backward scan less than
	 *
	 * @param cursor the cursor handle
	 * @param exactp the status of the search: 0 if an exact match is
	 * found, < 0 if a smaller key is returned, > 0 if a larger key is
	 * returned
	 * @errors
	 */
	int __F(search_near)(WT_CURSOR *cursor, int *exactp);
	/*! @} */

	/*! @name Data modification
	 * @{
	 */
	/*! Insert a record, and optionally overwrite an existing record.
	 * If the cursor was not configured with "append" or "overwrite", both
	 * the key and value must be set and the record must not already exist;
	 * the record will be inserted.
	 *
	 * If the cursor was configured with "overwrite", both the key and value
	 * must be set; if the record already exists, the key's value will be
	 * updated, otherwise, the record will be inserted.
	 *
	 * In a cursor with record number keys was configured with "append",
	 * the value must be set; a new record will be appended and the record
	 * number set as the cursor key value.
	 *
	 * Inserting a new record after the current maximum record in a
	 * fixed-length bit field column-store (that is, a store with an
	 * 'r' type key and 't' type value) implicitly creates the missing
	 * records as records with a value of 0.
	 *
	 * @snippet ex_all.c Insert a new record
	 *
	 * @snippet ex_all.c Insert a new record or overwrite an existing record
	 *
	 * @snippet ex_all.c Insert a new record and assign a record number
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(insert)(WT_CURSOR *cursor);

	/*! Update a record.  Both key and value must be set, the key must
	 * exist, and the value of the key's record will be updated.
	 *
	 * @snippet ex_all.c Update an existing record
	 *
	 * @param cursor the cursor handle
	 * @errors
	 * In particular, if no record with the specified key exists,
	 * ::WT_NOTFOUND is returned.
	 */
	int __F(update)(WT_CURSOR *cursor);

	/*! Remove a record.  The key must be set, and the key's record will be
	 * removed.
	 *
	 * Removing a record in a fixed-length bit field column-store
	 * (that is, a store with an 'r' type key and 't' type value) is
	 * identical to setting the record's value to 0.
	 *
	 * @snippet ex_all.c Remove a record
	 *
	 * @param cursor the cursor handle
	 * @errors
	 * In particular, if no record with the specified key exists,
	 * ::WT_NOTFOUND is returned.
	 */
	int __F(remove)(WT_CURSOR *cursor);
	/*! @} */

	/*! Close the cursor.
	 *
	 * This releases the resources associated with the cursor handle.
	 * Cursors are closed implicitly by ending the enclosing transaction or
	 * closing the session in which they were opened.
	 *
	 * @snippet ex_all.c Close the cursor
	 *
	 * @param cursor the cursor handle
	 * @errors
	 */
	int __F(close)(WT_CURSOR *cursor);

	/*
	 * Protected fields, only to be used by cursor implementations.
	 */
#if !defined(SWIG) && !defined(DOXYGEN)
	/*
	 * !!!
	 * Explicit representations of structures from queue.h.
	 * TAILQ_ENTRY(wt_cursor) q;
	 */
	struct {
		WT_CURSOR *tqe_next;
		WT_CURSOR **tqe_prev;
	} q;				/* Linked list of WT_CURSORs. */

	uint64_t recno;
	uint8_t raw_recno_buf[WT_INTPACK64_MAXSIZE];
					/* Holds a recno in raw mode. */
	WT_ITEM key, value;
	int saved_err;			/* Saved error in set_{key,value}. */

#define	WT_CURSTD_APPEND	0x0001
#define	WT_CURSTD_DUMP_HEX	0x0002
#define	WT_CURSTD_DUMP_PRINT	0x0004
#define	WT_CURSTD_KEY_SET	0x0008
#define	WT_CURSTD_OPEN		0x0010
#define	WT_CURSTD_OVERWRITE	0x0020
#define	WT_CURSTD_RAW		0x0040
#define	WT_CURSTD_VALUE_SET	0x0080
	uint32_t flags;
#endif
};

/*!
 * All data operations are performed in the context of a WT_SESSION.  This
 * encapsulates the thread and transactional context of the operation.
 *
 * <b>Thread safety:</b> A WT_SESSION handle is not usually shared between
 * threads, see @ref threads for more information.
 */
struct __wt_session {
	/*! The connection for this session. */
	WT_CONNECTION *connection;

	/*! Close the session handle.
	 *
	 * This will release the resources associated with the session handle,
	 * including rolling back any active transactions and closing any
	 * cursors that remain open in the session.
	 *
	 * @snippet ex_all.c Close a session
	 *
	 * @param session the session handle
	 * @configempty{session.close, see dist/api_data.py}
	 * @errors
	 */
	int __F(close)(WT_SESSION *session, const char *config);

	/*! Reconfigure a session handle.
	 *
	 * @snippet ex_all.c Reconfigure a session
	 *
	 * WT_SESSION::reconfigure will fail if a transaction is in progress
	 * in the session.
	 * All open cursors are reset.
	 *
	 * @param session the session handle
	 * @configstart{session.reconfigure, see dist/api_data.py}
	 * @config{isolation, the default isolation level for operations in this
	 * session.,a string\, chosen from the following options: \c
	 * "read-uncommitted"\, \c "read-committed"\, \c "snapshot"; default \c
	 * read-committed.}
	 * @configend
	 * @errors
	 */
	int __F(reconfigure)(WT_SESSION *session, const char *config);

	/*! @name Cursor handles
	 * @{
	 */

	/*! Open a new cursor on a data source or duplicate an existing cursor.
	 *
	 * @snippet ex_all.c Open a cursor
	 *
	 * An existing cursor can be duplicated by passing it as the \c to_dup
	 * parameter and setting the \c uri parameter to \c NULL:
	 *
	 * @snippet ex_all.c Duplicate a cursor
	 *
	 * Cursors being duplicated must have a key set, and successfully
	 * duplicated cursors are positioned at the same place in the data
	 * source as the original.
	 *
	 * To reconfigure a cursor, duplicate it with a new configuration value:
	 *
	 * @snippet ex_all.c Reconfigure a cursor
	 *
	 * Cursor handles should be discarded by calling WT_CURSOR::close.
	 *
	 * Cursors capable of supporting transactional operations operate in the
	 * context of the current transaction, if any.  Ending a transaction
	 * implicitly resets all open cursors.
	 *
	 * Cursors are relatively light-weight objects but may hold references
	 * to heavier-weight objects; applications should re-use cursors when
	 * possible, but instantiating new cursors is not so expensive that
	 * applications need to cache cursors at all cost.
	 *
	 * @param session the session handle
	 * @param uri the data source on which the cursor operates; cursors
	 *  are usually opened on tables, however, cursors can be opened on
	 *  any data source, regardless of whether it is ultimately stored
	 *  in a table.  Some cursor types may have limited functionality
	 *  (for example, they may be read-only or not support transactional
	 *  updates).  See @ref data_sources for more information.
	 *  <br>
	 *  The following are the builtin cursor types:
	 *  <table>
	 *  @hrow{URI, Type, Key/Value types}
	 *  @row{<tt>backup:</tt>,
	 *	hot backup cursor,
	 *	key=<code>string</code>\, see @ref hot_backup for details}
	 *  @row{<tt>colgroup:\<tablename\>.\<columnset\></tt>,
	 *	column group cursor,
	 *	table key\, column group value(s)}
	 *  @row{<tt>table:\<tablename\></tt>,
	 *	table cursor,
	 *	table key\, table value(s)}
	 *  @row{<tt>file:\<filename\></tt>,
	 *	file cursor,
	 *	file key\, file value(s)}
	 *  @row{<tt>index:\<tablename\>.\<indexname\></tt>,
	 *	index cursor,
	 *	key=index key\, value=table value(s)}
	 *  @row{<tt>statistics:[file</tt><tt>:\<filename\>]</tt>,
	 *	database or file statistics cursor,
	 *	key=<code>int id</code>\, value=(<code>string description\,
	 *	string value\, uint64_t value</code>)\,
	 *	see @ref data_statistics for details}
	 *  </table>
	 * @param to_dup a cursor to duplicate
	 * @param session the session handle
	 * @configstart{session.open_cursor, see dist/api_data.py}
	 * @config{append, append the value as a new record\, creating a new
	 * record number key; valid only for cursors with record number keys.,a
	 * boolean flag; default \c false.}
	 * @config{bulk, configure the cursor for bulk loads\, a fast load path
	 * that may only be used for newly created objects. Cursors configured
	 * for bulk load only support the WT_CURSOR::insert and WT_CURSOR::close
	 * methods.  The value is usually a true/false flag\, but the the
	 * special value \c "bitmap" is for use with fixed-length column
	 * stores\, and allows chunks of a memory resident bitmap to be loaded
	 * directly into a file by passing a \c WT_ITEM to WT_CURSOR::set_value
	 * where the \c size field indicates the number of records in the bitmap
	 * (as specified by the file's \c value_format). Bulk load bitmap values
	 * must end on a byte boundary relative to the bit count - except for
	 * the last set of values loaded.,a string; default \c false.}
	 * @config{checkpoint, the name of a checkpoint to open (the reserved
	 * name "WiredTigerCheckpoint" opens the most recent internal checkpoint
	 * taken for the object).  The cursor does not support data
	 * modification.,a string; default empty.}
	 * @config{dump, configure the cursor for dump format inputs and
	 * outputs: "hex" selects a simple hexadecimal format\, "print" selects
	 * a format where only non-printing characters are hexadecimal encoded.
	 * The cursor dump format is compatible with the @ref util_dump and @ref
	 * util_load commands.,a string\, chosen from the following options: \c
	 * "hex"\, \c "print"; default empty.}
	 * @config{next_random, configure the cursor to return a pseudo-random
	 * record from the object; valid only for row-store cursors.  Cursors
	 * configured with next_random only support the WT_CURSOR::next and
	 * WT_CURSOR::close methods.  See @ref cursor_random for details.,a
	 * boolean flag; default \c false.}
	 * @config{overwrite, change the behavior of the cursor's insert method
	 * to overwrite previously existing values.,a boolean flag; default \c
	 * false.}
	 * @config{raw, ignore the encodings for the key and value\, manage data
	 * as if the formats were \c "u".  See @ref cursor_raw for details.,a
	 * boolean flag; default \c false.}
	 * @config{statistics, configure the cursor for statistics.,a boolean
	 * flag; default \c false.}
	 * @config{statistics_clear, reset statistics counters when the cursor
	 * is closed; valid only for statistics cursors.,a boolean flag; default
	 * \c false.}
	 * @config{statistics_fast, only gather statistics that don't require
	 * traversing the tree; valid only for statistics cursors.,a boolean
	 * flag; default \c false.}
	 * @config{target, if non-empty\, backup the list of objects; valid only
	 * for a backup data source.,a list of strings; default empty.}
	 * @configend
	 * @param cursorp a pointer to the newly opened cursor
	 * @errors
	 */
	int __F(open_cursor)(WT_SESSION *session,
	    const char *uri, WT_CURSOR *to_dup,
	    const char *config, WT_CURSOR **cursorp);
	/*! @} */

	/*! @name Table operations
	 * @{
	 */
	/*! Create a table, column group, index or file.
	 *
	 * @snippet ex_all.c Create a table
	 *
	 * @param session the session handle
	 * @param name the URI of the object to create, such as \c "table:stock"
	 * @configstart{session.create, see dist/api_data.py}
	 * @config{allocation_size, the file unit allocation size\, in bytes\,
	 * must a power-of-two; smaller values decrease the file space required
	 * by overflow items\, and the default value of 512B is a good choice
	 * absent requirements from the operating system or storage device.,an
	 * integer between 512B and 128MB; default \c 512B.}
	 * @config{block_compressor, configure a compressor for file blocks.
	 * Permitted values are empty (off) or \c "bzip2"\, \c "snappy" or
	 * custom compression engine \c "name" created with
	 * WT_CONNECTION::add_compressor. See @ref compression for more
	 * information.,a string; default empty.}
	 * @config{cache_resident, do not ever evict the object's pages; see
	 * @ref tuning_cache_resident for more information.,a boolean flag;
	 * default \c false.}
	 * @config{checksum, configure file block checksums; if false\, the
	 * block manager is free to not write or check block checksums. This can
	 * increase performance in applications where compression provides
	 * checksum functionality or read-only applications where blocks require
	 * no verification.,a boolean flag; default \c true.}
	 * @config{colgroups, comma-separated list of names of column groups.
	 * Each column group is stored separately\, keyed by the primary key of
	 * the table.  If no column groups are specified\, all columns are
	 * stored together in a single file.  All value columns in the table
	 * must appear in at least one column group.  Each column group must be
	 * created with a separate call to WT_SESSION::create.,a list of
	 * strings; default empty.}
	 * @config{collator, configure custom collation for keys.  Value must be
	 * a collator name created with WT_CONNECTION::add_collator.,a string;
	 * default empty.}
	 * @config{columns, list of the column names.  Comma-separated list of
	 * the form <code>(column[\,...])</code>.  For tables\, the number of
	 * entries must match the total number of values in \c key_format and \c
	 * value_format.  For colgroups and indices\, all column names must
	 * appear in the list of columns for the table.,a list of strings;
	 * default empty.}
	 * @config{dictionary, the maximum number of unique values remembered in
	 * the Btree row-store leaf page value dictionary; see @ref
	 * file_formats_compression for more information.,an integer greater
	 * than or equal to 0; default \c 0.}
	 * @config{exclusive, fail if the object exists.  When false (the
	 * default)\, if the object exists\, check that its settings match the
	 * specified configuration.,a boolean flag; default \c false.}
	 * @config{format, the file format.,a string\, chosen from the following
	 * options: \c "btree"; default \c btree.}
	 * @config{huffman_key, configure Huffman encoding for keys.  Permitted
	 * values are empty (off)\, \c "english"\, \c "utf8<file>" or \c
	 * "utf16<file>".  See @ref huffman for more information.,a string;
	 * default empty.}
	 * @config{huffman_value, configure Huffman encoding for values.
	 * Permitted values are empty (off)\, \c "english"\, \c "utf8<file>" or
	 * \c "utf16<file>".  See @ref huffman for more information.,a string;
	 * default empty.}
	 * @config{internal_item_max, the maximum key size stored on internal
	 * nodes\, in bytes.  If zero\, a maximum is calculated to permit at
	 * least 8 keys per internal page.,an integer greater than or equal to
	 * 0; default \c 0.}
	 * @config{internal_key_truncate, configure internal key truncation\,
	 * discarding unnecessary trailing bytes on internal keys (ignored for
	 * custom collators).,a boolean flag; default \c true.}
	 * @config{internal_page_max, the maximum page size for internal nodes\,
	 * in bytes; the size must be a multiple of the allocation size and is
	 * significant for applications wanting to avoid excessive L2 cache
	 * misses while searching the tree.,an integer between 512B and 512MB;
	 * default \c 2KB.}
	 * @config{key_format, the format of the data packed into key items.
	 * See @ref schema_format_types for details.  By default\, the
	 * key_format is \c 'u' and applications use WT_ITEM structures to
	 * manipulate raw byte arrays. By default\, records are stored in
	 * row-store files: keys of type \c 'r' are record numbers and records
	 * referenced by record number are stored in column-store files.,a
	 * format string; default \c u.}
	 * @config{key_gap, the maximum gap between instantiated keys in a Btree
	 * leaf page\, constraining the number of keys processed to instantiate
	 * a random Btree leaf page key.,an integer greater than or equal to 0;
	 * default \c 10.}
	 * @config{leaf_item_max, the maximum key or value size stored on leaf
	 * nodes\, in bytes. If zero\, a size is calculated to permit at least 8
	 * items (values or row store keys) per leaf page.,an integer greater
	 * than or equal to 0; default \c 0.}
	 * @config{leaf_page_max, the maximum page size for leaf nodes\, in
	 * bytes; the size must be a multiple of the allocation size\, and is
	 * significant for applications wanting to maximize sequential data
	 * transfer from a storage device.,an integer between 512B and 512MB;
	 * default \c 1MB.}
	 * @config{lsm_bloom, create bloom filters on LSM tree chunks as they
	 * are merged.,a boolean flag; default \c true.}
	 * @config{lsm_bloom_bit_count, the number of bits used per item for LSM
	 * bloom filters.,an integer between 2 and 1000; default \c 8.}
	 * @config{lsm_bloom_config, config string used when creating Bloom
	 * filter files\, passed to WT_SESSION::create.,a string; default
	 * empty.}
	 * @config{lsm_bloom_hash_count, the number of hash values per item used
	 * for LSM bloom filters.,an integer between 2 and 100; default \c 4.}
	 * @config{lsm_bloom_newest, create a bloom filter on an LSM tree chunk
	 * before it's first merge. Only supported if bloom filters are
	 * enabled.,a boolean flag; default \c false.}
	 * @config{lsm_bloom_oldest, create a bloom filter on the oldest LSM
	 * tree chunk. Only supported if bloom filters are enabled.,a boolean
	 * flag; default \c false.}
	 * @config{lsm_chunk_size, the maximum size of the in-memory chunk of an
	 * LSM tree.,an integer between 512K and 500MB; default \c 2MB.}
	 * @config{lsm_merge_max, the maximum number of chunks to include in a
	 * merge operation.,an integer between 2 and 100; default \c 15.}
	 * @config{lsm_merge_threads, the number of thread to perform merge
	 * operations.,an integer between 1 and 10; default \c 1.}
	 * @config{prefix_compression, configure row-store format key prefix
	 * compression.,a boolean flag; default \c true.}
	 * @config{source, override the default data source URI derived from the
	 * object name.,a string; default empty.}
	 * @config{split_pct, the Btree page split size as a percentage of the
	 * maximum Btree page size\, that is\, when a Btree page is split\, it
	 * will be split into smaller pages\, where each page is the specified
	 * percentage of the maximum Btree page size.,an integer between 25 and
	 * 100; default \c 75.}
	 * @config{type, set the data source type.  This setting overrides the
	 * URI prefix for the data source\, if no \c source configuration
	 * setting is provided.,a string\, chosen from the following options: \c
	 * "file"\, \c "lsm"; default \c file.}
	 * @config{value_format, the format of the data packed into value items.
	 * See @ref schema_format_types for details.  By default\, the
	 * value_format is \c 'u' and applications use a WT_ITEM structure to
	 * manipulate raw byte arrays. Value items of type 't' are bitfields\,
	 * and when configured with record number type keys\, will be stored
	 * using a fixed-length store.,a format string; default \c u.}
	 * @configend
	 * @errors
	 */
	int __F(create)(WT_SESSION *session,
	    const char *name, const char *config);

	/*! Compact an object.
	 *
	 * @snippet ex_all.c Compact a table
	 *
	 * @param session the session handle
	 * @param name the URI of the object to drop, such as \c "table:stock"
	 * @configempty{session.compact, see dist/api_data.py}
	 * @errors
	 */
	int __F(compact)(WT_SESSION *session,
	    const char *name, const char *config);

	/*! Drop (delete) an object.
	 *
	 * @snippet ex_all.c Drop a table
	 *
	 * @param session the session handle
	 * @param name the URI of the object to drop, such as \c "table:stock"
	 * @configstart{session.drop, see dist/api_data.py}
	 * @config{force, return success if the object does not exist.,a boolean
	 * flag; default \c false.}
	 * @configend
	 * @errors
	 */
	int __F(drop)(WT_SESSION *session,
	    const char *name, const char *config);

	/*! Rename an object.
	 *
	 * @snippet ex_all.c Rename a table
	 *
	 * @param session the session handle
	 * @param oldname the current URI of the object, such as \c "table:old"
	 * @param newname the new name of the object, such as \c "table:new"
	 * @configempty{session.rename, see dist/api_data.py}
	 * @errors
	 */
	int __F(rename)(WT_SESSION *session,
	    const char *oldname, const char *newname, const char *config);

	/*! Salvage a file or table
	 *
	 * Salvage rebuilds the file, or files of which a table is comprised,
	 * discarding any corrupted file blocks.
	 *
	 * Previously deleted records may re-appear, and inserted records may
	 * disappear, when salvage is done, so salvage should not be run
	 * unless it is known to be necessary.  Normally, salvage should be
	 * called after a file or table has been corrupted, as reported by the
	 * WT_SESSION::verify method.
	 *
	 * Files are rebuilt in place, the salvage method overwrites the
	 * existing files.
	 *
	 * @snippet ex_all.c Salvage a table
	 *
	 * @param session the session handle
	 * @param name the URI of the file or table to salvage
	 * @configstart{session.salvage, see dist/api_data.py}
	 * @config{force, force salvage even of files that do not appear to be
	 * WiredTiger files.,a boolean flag; default \c false.}
	 * @configend
	 * @errors
	 */
	int __F(salvage)(WT_SESSION *session,
	    const char *name, const char *config);

	/*! Truncate a file, table or cursor range.
	 *
	 * Truncate a file or table.
	 * @snippet ex_all.c Truncate a table
	 *
	 * Truncate a cursor range.  When truncating based on a cursor position,
	 * it is not required the cursor reference a record in the object, only
	 * that the key be set.  This allows applications to discard portions of
	 * the object name space without knowing exactly what records the object
	 * contains.
	 * @snippet ex_all.c Truncate a range
	 *
	 * @param session the session handle
	 * @param name the URI of the file or table to truncate
	 * @param start optional cursor marking the first record discarded;
	 * if <code>NULL</code>, the truncate starts from the beginning of
	 * the object
	 * @param stop optional cursor marking the last record discarded;
	 * if <code>NULL</code>, the truncate continues to the end of the
	 * object
	 * @configempty{session.truncate, see dist/api_data.py}
	 * @errors
	 */
	int __F(truncate)(WT_SESSION *session,
	    const char *name,
	    WT_CURSOR *start, WT_CURSOR *stop, const char *config);

	/*! Upgrade a file or table.
	 *
	 * Upgrade upgrades a file or table, if upgrade is required.
	 *
	 * @snippet ex_all.c Upgrade a table
	 *
	 * @param session the session handle
	 * @param name the URI of the file or table to upgrade
	 * @configempty{session.upgrade, see dist/api_data.py}
	 * @errors
	 */
	int __F(upgrade)(WT_SESSION *session,
	    const char *name, const char *config);

	/*! Verify a file or table.
	 *
	 * Verify reports if a file, or the files of which a table is
	 * comprised, have been corrupted.  The WT_SESSION::salvage method
	 * can be used to repair a corrupted file,
	 *
	 * @snippet ex_all.c Verify a table
	 *
	 * @param session the session handle
	 * @param name the URI of the file or table to verify
	 * @configstart{session.verify, see dist/api_data.py}
	 * @config{dump_address, Display addresses and page types as pages are
	 * verified\, using the application's message handler\, intended for
	 * debugging.,a boolean flag; default \c false.}
	 * @config{dump_blocks, Display the contents of on-disk blocks as they
	 * are verified\, using the application's message handler\, intended for
	 * debugging.,a boolean flag; default \c false.}
	 * @config{dump_pages, Display the contents of in-memory pages as they
	 * are verified\, using the application's message handler\, intended for
	 * debugging.,a boolean flag; default \c false.}
	 * @configend
	 * @errors
	 */
	int __F(verify)(WT_SESSION *session,
	    const char *name, const char *config);
	/*! @} */

	/*! @name Transactions
	 * @{
	 */
	/*! Start a transaction in this session.
	 *
	 * The transaction remains active until ended by
	 * WT_SESSION::commit_transaction or WT_SESSION::rollback_transaction.
	 * Operations performed on cursors capable of supporting transactional
	 * operations that are already open in this session, or which are opened
	 * before the transaction ends, will operate in the context of the
	 * transaction.
	 *
	 * All open cursors are reset.
	 *
	 * WT_SESSION::transaction_begin will fail if a transaction is already
	 * in progress in the session.
	 *
	 * @snippet ex_all.c transaction commit/rollback
	 *
	 * @param session the session handle
	 * @configstart{session.begin_transaction, see dist/api_data.py}
	 * @config{isolation, the isolation level for this transaction; defaults
	 * to the session's isolation level.,a string\, chosen from the
	 * following options: \c "read-uncommitted"\, \c "read-committed"\, \c
	 * "snapshot"; default empty.}
	 * @config{name, name of the transaction for tracing and debugging.,a
	 * string; default empty.}
	 * @config{priority, priority of the transaction for resolving
	 * conflicts. Transactions with higher values are less likely to
	 * abort.,an integer between -100 and 100; default \c 0.}
	 * @config{sync, how to sync log records when the transaction commits.,a
	 * string\, chosen from the following options: \c "full"\, \c "flush"\,
	 * \c "write"\, \c "none"; default \c full.}
	 * @configend
	 * @errors
	 */
	int __F(begin_transaction)(WT_SESSION *session, const char *config);

	/*! Commit the current transaction.
	 *
	 * A transaction must be in progress when this method is called.
	 *
	 * All open cursors are reset.
	 *
	 * If WT_SESSION::commit_transaction returns an error, the transaction
	 * was rolled-back, not committed.
	 *
	 * @snippet ex_all.c transaction commit/rollback
	 *
	 * @param session the session handle
	 * @configempty{session.commit_transaction, see dist/api_data.py}
	 * @errors
	 */
	int __F(commit_transaction)(WT_SESSION *session, const char *config);

	/*! Roll back the current transaction.
	 *
	 * A transaction must be in progress when this method is called.
	 *
	 * All open cursors are reset.
	 *
	 * @snippet ex_all.c transaction commit/rollback
	 *
	 * @param session the session handle
	 * @configempty{session.rollback_transaction, see dist/api_data.py}
	 * @errors
	 */
	int __F(rollback_transaction)(WT_SESSION *session, const char *config);

	/*! Write a transactionally consistent snapshot of a database or set of
	 * objects.  The checkpoint includes all transactions committed before
	 * the checkpoint starts.  Additionally, checkpoints may optionally be
	 * discarded.
	 *
	 * @snippet ex_all.c Checkpoint examples
	 *
	 * @param session the session handle
	 * @configstart{session.checkpoint, see dist/api_data.py}
	 * @config{drop, specify a list of checkpoints to drop. The list may
	 * additionally contain one of the following keys: \c "from=all" to drop
	 * all checkpoints\, \c "from=<checkpoint>" to drop all checkpoints
	 * after and including the named checkpoint\, or \c "to=<checkpoint>" to
	 * drop all checkpoints before and including the named checkpoint.
	 * Checkpoints cannot be dropped while a hot backup is in progress or if
	 * open in a cursor.,a list of strings; default empty.}
	 * @config{force, checkpoints may be skipped if the underlying object
	 * has not been modified\, this option forces the checkpoint.,a boolean
	 * flag; default \c false.}
	 * @config{name, if non-empty\, specify a name for the checkpoint.,a
	 * string; default empty.}
	 * @config{target, if non-empty\, checkpoint the list of objects.,a list
	 * of strings; default empty.}
	 * @configend
	 * @errors
	 */
	int __F(checkpoint)(WT_SESSION *session, const char *config);

	/*! @} */
	/*! @name Debugging
	 * @{
	 */

	/*! Send a string to the message handler for debugging.
	 *
	 * @snippet ex_all.c Print to the message stream
	 *
	 * @param session the session handle
	 * @param fmt a printf-like format specification
	 * @errors
	 */
	int __F(msg_printf)(WT_SESSION *session, const char *fmt, ...);

	/*! @} */
};

/*!
 * A connection to a WiredTiger database.  The connection may be opened within
 * the same address space as the caller or accessed over a socket connection.
 *
 * Most applications will open a single connection to a database for each
 * process.  The first process to open a connection to a database will access
 * the database in its own address space.  Subsequent connections (if allowed)
 * will communicate with the first process over a socket connection to perform
 * their operations.
 *
 * <b>Thread safety:</b> A WT_CONNECTION handle may be shared between threads,
 * see @ref threads for more information.
 */
struct __wt_connection {
	/*! Close a connection.
	 *
	 * Any open sessions will be closed.
	 *
	 * @snippet ex_all.c Close a connection
	 *
	 * @param connection the connection handle
	 * @configempty{connection.close, see dist/api_data.py}
	 * @errors
	 */
	int __F(close)(WT_CONNECTION *connection, const char *config);

	/*! Reconfigure a connection handle.
	 *
	 * @snippet ex_all.c Reconfigure a connection
	 *
	 * @param connection the connection handle
	 * @configstart{connection.reconfigure, see dist/api_data.py}
	 * @config{cache_size, maximum heap memory to allocate for the cache. A
	 * database should configure either a cache_size or a shared_cache not
	 * both.,an integer between 1MB and 10TB; default \c 100MB.}
	 * @config{error_prefix, prefix string for error messages.,a string;
	 * default empty.}
	 * @config{eviction_target, continue evicting until the cache becomes
	 * less full than this (as a percentage).  Must be less than \c
	 * eviction_trigger.,an integer between 10 and 99; default \c 80.}
	 * @config{eviction_trigger, trigger eviction when the cache becomes
	 * this full (as a percentage).,an integer between 10 and 99; default \c
	 * 95.}
	 * @config{shared_cache = (, shared cache configuration options. A
	 * database should configure either a cache_size or a shared_cache not
	 * both.,a set of related configuration options defined
	 * below.}@config{&nbsp;&nbsp;&nbsp;&nbsp;chunk, the granularity that a
	 * shared cache is redistributed.,an integer between 1MB and 10TB;
	 * default \c 10MB.}@config{&nbsp;&nbsp;&nbsp;&nbsp;min, minimum amount
	 * of cache a database in a shared cache can have.,an integer between
	 * 10MB and 10TB; default \c 50MB.}@config{&nbsp;&nbsp;&nbsp;&nbsp;name,
	 * name of a cache that is shared between databases.,a string; default
	 * empty.}@config{&nbsp;&nbsp;&nbsp;&nbsp;size, maximum memory to
	 * allocate for the shared cache.,an integer between 1MB and 10TB;
	 * default \c 500MB.}@config{ ),,}
	 * @config{verbose, enable messages for various events.  Options are
	 * given as a list\, such as
	 * <code>"verbose=[evictserver\,read]"</code>.,a list\, with values
	 * chosen from the following options: \c "block"\, \c "shared_cache"\,
	 * \c "ckpt"\, \c "evict"\, \c "evictserver"\, \c "fileops"\, \c
	 * "hazard"\, \c "lsm"\, \c "mutex"\, \c "read"\, \c "readserver"\, \c
	 * "reconcile"\, \c "salvage"\, \c "verify"\, \c "write"; default
	 * empty.}
	 * @configend
	 * @errors
	 */
	int __F(reconfigure)(WT_CONNECTION *connection, const char *config);

	/*! The home directory of the connection.
	 *
	 * @snippet ex_all.c Get the database home directory
	 *
	 * @param connection the connection handle
	 * @returns a pointer to a string naming the home directory
	 */
	const char *__F(get_home)(WT_CONNECTION *connection);

	/*! Return if opening this handle created the database.
	 *
	 * @snippet ex_all.c Check if the database is newly created
	 *
	 * @param connection the connection handle
	 * @returns false (zero) if the connection existed before the call to
	 * ::wiredtiger_open, true (non-zero) if it was created by opening this
	 * handle.
	 */
	int __F(is_new)(WT_CONNECTION *connection);

	/*! @name Session handles
	 * @{
	 */
	/*! Open a session.
	 *
	 * @snippet ex_all.c Open a session
	 *
	 * @param connection the connection handle
	 * @param errhandler An error handler.  If <code>NULL</code>, the
	 * connection's error handler is used
	 * @configstart{connection.open_session, see dist/api_data.py}
	 * @config{isolation, the default isolation level for operations in this
	 * session.,a string\, chosen from the following options: \c
	 * "read-uncommitted"\, \c "read-committed"\, \c "snapshot"; default \c
	 * read-committed.}
	 * @configend
	 * @param sessionp the new session handle
	 * @errors
	 */
	int __F(open_session)(WT_CONNECTION *connection,
	    WT_EVENT_HANDLER *errhandler, const char *config,
	    WT_SESSION **sessionp);
	/*! @} */

	/*! @name Extensions
	 * @{
	 */
	/*! Load an extension.
	 *
	 * @snippet ex_all.c Load an extension
	 *
	 * @param connection the connection handle
	 * @param path the filename of the extension module
	 * @configstart{connection.load_extension, see dist/api_data.py}
	 * @config{entry, the entry point of the extension.,a string; default \c
	 * wiredtiger_extension_init.}
	 * @config{prefix, a prefix for all names registered by this extension
	 * (e.g.\, to make namespaces distinct or during upgrades.,a string;
	 * default empty.}
	 * @configend
	 * @errors
	 */
	int __F(load_extension)(WT_CONNECTION *connection,
	    const char *path, const char *config);

	/*! Add a custom data source. @notyet{custom data sources}
	 *
	 * The application must first implement the WT_DATA_SOURCE interface
	 * and then register the implementation with WiredTiger:
	 *
	 * @snippet ex_all.c WT_DATA_SOURCE register
	 *
	 * @param connection the connection handle
	 * @param prefix the URI prefix for this data source, e.g., "file:"
	 * @param data_source the application-supplied implementation of
	 *	WT_DATA_SOURCE to manage this data source.
	 * @configempty{connection.add_data_source, see dist/api_data.py}
	 * @errors
	 */
	int __F(add_data_source)(WT_CONNECTION *connection, const char *prefix,
	    WT_DATA_SOURCE *data_source, const char *config);

	/*! Add a custom collation function.
	 *
	 * The application must first implement the WT_COLLATOR interface and
	 * then register the implementation with WiredTiger:
	 *
	 * @snippet ex_all.c WT_COLLATOR register
	 *
	 * @param connection the connection handle
	 * @param name the name of the collation to be used in calls to
	 * 	WT_SESSION::create
	 * @param collator the application-supplied collation handler
	 * @configempty{connection.add_collator, see dist/api_data.py}
	 * @errors
	 */
	int __F(add_collator)(WT_CONNECTION *connection,
	    const char *name, WT_COLLATOR *collator, const char *config);

	/*! Add a compression function.
	 *
	 * The application must first implement the WT_COMPRESSOR interface
	 * and then register the implementation with WiredTiger:
	 *
	 * @snippet ex_all.c WT_COMPRESSOR register
	 *
	 * @param connection the connection handle
	 * @param name the name of the compression function to be used in calls
	 *	to WT_SESSION::create
	 * @param compressor the application-supplied compression handler
	 * @configempty{connection.add_compressor, see dist/api_data.py}
	 * @errors
	 */
	int __F(add_compressor)(WT_CONNECTION *connection,
	    const char *name, WT_COMPRESSOR *compressor, const char *config);

	/*! Add a custom extractor for index keys or column groups.
	 * @notyet{custom extractors}
	 *
	 * The application must first implement the WT_EXTRACTOR interface and
	 * then register the implementation with WiredTiger:
	 *
	 * @snippet ex_all.c WT_EXTRACTOR register
	 *
	 * @param connection the connection handle
	 * @param name the name of the extractor to be used in calls to
	 * 	WT_SESSION::create
	 * @param extractor the application-supplied extractor
	 * @configempty{connection.add_extractor, see dist/api_data.py}
	 * @errors
	 */
	int __F(add_extractor)(WT_CONNECTION *connection, const char *name,
	    WT_EXTRACTOR *extractor, const char *config);
	/*! @} */
};

/*! Open a connection to a database.
 *
 * @snippet ex_all.c Open a connection
 *
 * @param home The path to the database home directory.  See @ref home
 * for more information.
 * @param errhandler An error handler.  If <code>NULL</code>, a builtin error
 * handler is installed that writes error messages to stderr
 * @configstart{wiredtiger_open, see dist/api_data.py}
 * @config{buffer_alignment, in-memory alignment (in bytes) for buffers used for
 * I/O.  The default value of -1 indicates that a platform-specific alignment
 * value should be used (512 bytes on Linux systems\, zero elsewhere).,an
 * integer between -1 and 1MB; default \c -1.}
 * @config{cache_size, maximum heap memory to allocate for the cache. A database
 * should configure either a cache_size or a shared_cache not both.,an integer
 * between 1MB and 10TB; default \c 100MB.}
 * @config{create, create the database if it does not exist.,a boolean flag;
 * default \c false.}
 * @config{direct_io, Use \c O_DIRECT to access files.  Options are given as a
 * list\, such as <code>"direct_io=[data]"</code>.,a list\, with values chosen
 * from the following options: \c "data"\, \c "log"; default empty.}
 * @config{error_prefix, prefix string for error messages.,a string; default
 * empty.}
 * @config{eviction_target, continue evicting until the cache becomes less full
 * than this (as a percentage).  Must be less than \c eviction_trigger.,an
 * integer between 10 and 99; default \c 80.}
 * @config{eviction_trigger, trigger eviction when the cache becomes this full
 * (as a percentage).,an integer between 10 and 99; default \c 95.}
 * @config{extensions, list of shared library extensions to load (using dlopen).
 * Optional values are passed as the \c config parameter to
 * WT_CONNECTION::load_extension.  Complex paths may require quoting\, for
 * example\, <code>extensions=("/path/ext.so"="entry=my_entry")</code>.,a list
 * of strings; default empty.}
 * @config{hazard_max, maximum number of simultaneous hazard references per
 * session handle.,an integer greater than or equal to 15; default \c 1000.}
 * @config{logging, enable logging.,a boolean flag; default \c false.}
 * @config{lsm_merge, merge LSM chunks where possible.,a boolean flag; default
 * \c true.}
 * @config{multiprocess, permit sharing between processes (will automatically
 * start an RPC server for primary processes and use RPC for secondary
 * processes). <b>Not yet supported in WiredTiger</b>.,a boolean flag; default
 * \c false.}
 * @config{session_max, maximum expected number of sessions (including server
 * threads).,an integer greater than or equal to 1; default \c 50.}
 * @config{shared_cache = (, shared cache configuration options. A database
 * should configure either a cache_size or a shared_cache not both.,a set of
 * related configuration options defined
 * below.}@config{&nbsp;&nbsp;&nbsp;&nbsp;chunk, the granularity that a shared
 * cache is redistributed.,an integer between 1MB and 10TB; default \c
 * 10MB.}@config{&nbsp;&nbsp;&nbsp;&nbsp;min, minimum amount of cache a database
 * in a shared cache can have.,an integer between 10MB and 10TB; default \c
 * 50MB.}@config{&nbsp;&nbsp;&nbsp;&nbsp;name, name of a cache that is shared
 * between databases.,a string; default
 * empty.}@config{&nbsp;&nbsp;&nbsp;&nbsp;size, maximum memory to allocate for
 * the shared cache.,an integer between 1MB and 10TB; default \c 500MB.}@config{
 * ),,}
 * @config{sync, flush files to stable storage when closing or writing
 * checkpoints.,a boolean flag; default \c true.}
 * @config{transactional, support transactional semantics.,a boolean flag;
 * default \c true.}
 * @config{use_environment_priv, use the \c WIREDTIGER_CONFIG and \c
 * WIREDTIGER_HOME environment variables regardless of whether or not the
 * process is running with special privileges.  See @ref home for more
 * information.,a boolean flag; default \c false.}
 * @config{verbose, enable messages for various events.  Options are given as a
 * list\, such as <code>"verbose=[evictserver\,read]"</code>.,a list\, with
 * values chosen from the following options: \c "block"\, \c "shared_cache"\, \c
 * "ckpt"\, \c "evict"\, \c "evictserver"\, \c "fileops"\, \c "hazard"\, \c
 * "lsm"\, \c "mutex"\, \c "read"\, \c "readserver"\, \c "reconcile"\, \c
 * "salvage"\, \c "verify"\, \c "write"; default empty.}
 * @configend
 * Additionally, if a file named \c WiredTiger.config appears in the WiredTiger
 * home directory, it is read for configuration values (see @ref config_file
 * for details).  Configuration values specified in the \c config argument to
 * the ::wiredtiger_open function override configuration values specified in
 * the \c WiredTiger.config file.
 * @param connectionp A pointer to the newly opened connection handle
 * @errors
 */
int wiredtiger_open(const char *home,
    WT_EVENT_HANDLER *errhandler, const char *config,
    WT_CONNECTION **connectionp);

/*! Return information about an error as a string; wiredtiger_strerror is a
 * superset of the ISO C99/POSIX 1003.1-2001 function strerror.
 *
 * @snippet ex_all.c Display an error
 *
 * @param err a return value from a WiredTiger, C library or POSIX function
 * @returns a string representation of the error
 */
const char *wiredtiger_strerror(int err);

/*!
 * The interface implemented by applications to handle error, informational and
 * progress messages.  Entries set to NULL are ignored and the default handlers
 * will continue to be used.
 */
struct __wt_event_handler {
	/*!
	 * Callback to handle error messages; by default, error messages are
	 * written to the stderr stream.  If the handler returns non-zero,
	 * the application's current operation will return an error.
	 *
	 * @param error a WiredTiger, C99 or POSIX error code, which can
	 * be converted to a string using ::wiredtiger_strerror
	 * @param message an error string
	 */
	int (*handle_error)(WT_EVENT_HANDLER *handler,
	    int error, const char *message);

	/*!
	 * Callback to handle informational messages; by default, informational
	 * messages are written to the stdout stream.  If the handler returns
	 * non-zero, the application's current operation will return an error.
	 *
	 * @param message an informational string
	 */
	int (*handle_message)(WT_EVENT_HANDLER *handler, const char *message);

	/*!
	 * Callback to handle progress messages; by default, no progress
	 * messages are written.  If the handler returns non-zero, the
	 * application's current operation will return an error.
	 *
	 * @param operation a string representation of the operation
	 * @param progress a counter
	 */
	int (*handle_progress)(WT_EVENT_HANDLER *handler,
	    const char *operation, uint64_t progress);
};

/*! Pack a structure into a buffer.
 *
 * See @ref packing for a description of the permitted format strings.
 *
 * @section pack_examples Packing Examples
 *
 * For example, the string <code>"iSh"</code> will pack a 32-bit integer
 * followed by a NUL-terminated string, followed by a 16-bit integer.  The
 * default, big-endian encoding will be used, with no alignment.  This could
 * be used in C as follows:
 *
 * @snippet ex_all.c Pack fields into a buffer
 *
 * Then later, the values can be unpacked as follows:
 *
 * @snippet ex_all.c Unpack fields from a buffer
 *
 * @param session the session handle
 * @param buffer a pointer to a packed byte array
 * @param size the number of valid bytes in the buffer
 * @param format the data format, see @ref packing
 * @errors
 */
int wiredtiger_struct_pack(
    WT_SESSION *session, void *buffer, size_t size, const char *format, ...);

/*! Calculate the size required to pack a structure.
 *
 * Note that for variable-sized fields including variable-sized strings and
 * integers, the calculated sized merely reflects the expected sizes specified
 * in the format string itself.
 *
 * @snippet ex_all.c Get the packed size
 *
 * @param session the session handle
 * @param sizep a location where the the number of bytes needed for the
 * matching call to ::wiredtiger_struct_pack is returned
 * @param format the data format, see @ref packing
 * @errors
 */
int wiredtiger_struct_size(
    WT_SESSION *session, size_t *sizep, const char *format, ...);

/*! Unpack a structure from a buffer.
 *
 * Reverse of ::wiredtiger_struct_pack: gets values out of a packed byte string.
 *
 * @snippet ex_all.c Unpack fields from a buffer
 *
 * @param session the session handle
 * @param buffer a pointer to a packed byte array
 * @param size the number of valid bytes in the buffer
 * @param format the data format, see @ref packing
 * @errors
 */
int wiredtiger_struct_unpack(WT_SESSION *session,
    const void *buffer, size_t size, const char *format, ...);

/*! Get version information.
 *
 * @snippet ex_all.c Get the WiredTiger library version #1
 * @snippet ex_all.c Get the WiredTiger library version #2
 *
 * @param majorp a location where the major version number is returned
 * @param minorp a location where the minor version number is returned
 * @param patchp a location where the patch version number is returned
 * @returns a string representation of the version
 */
const char *wiredtiger_version(int *majorp, int *minorp, int *patchp);

/*******************************************
 * Error returns
 *******************************************/
/*!
 * @anchor error_returns
 * @name Error returns
 * Most functions and methods in WiredTiger return an integer code indicating
 * whether the operation succeeded or failed.  A return of zero indicates
 * success, all non-zero return values indicate some kind of failure.
 *
 * WiredTiger reserves all values from -31,800 to -31,999 as possible error
 * return values.  WiredTiger may also return C99/POSIX error codes such as
 * \c ENOMEM, \c EINVAL and \c ENOTSUP, with the usual meanings.
 *
 * The following are all of the WiredTiger-specific error returns:
 * @{
 */
/*
 * DO NOT EDIT: automatically built by dist/api_err.py.
 * Error return section: BEGIN
 */
/*! Conflict between concurrent operations.
 * This error is generated when an operation cannot be completed due to a
 * conflict with concurrent operations.  The operation should be retried.  If a
 * transaction is in progress, it should be rolled back and the operation
 * retried in a new transaction.
 */
#define	WT_DEADLOCK	-31800
/*! Attempt to insert an existing key.
 * This error is generated when the application attempts to insert a record with
 * the same key as an existing record without the 'overwrite' configuration to
 * WT_SESSION::open_cursor.
 */
#define	WT_DUPLICATE_KEY	-31801
/*! Non-specific WiredTiger error.
 * This error is generated for cases that are not covered by specific error
 * returns.
 */
#define	WT_ERROR	-31802
/*! Cursor item not found.
 * This error indicates a cursor operation did not find a record to return.
 * This includes search and other operations where no record matched the
 * cursor's search key such as WT_CURSOR::update or WT_CURSOR::remove.
 */
#define	WT_NOTFOUND	-31803
/*! @cond internal */
/*! Restart the operation (internal). */
#define	WT_RESTART	-31804
/*! @endcond */
/*
 * Error return section: END
 * DO NOT EDIT: automatically built by dist/api_err.py.
 */
/*! @} */

/*! @} */

/*! @defgroup wt_ext WiredTiger Extension API
 * The functions and interfaces applications use to customize and extend the
 * behavior of WiredTiger.
 * @{
 */

/*!
 * The interface implemented by applications to provide custom ordering of
 * records.
 *
 * Applications register their implementation with WiredTiger by calling
 * WT_CONNECTION::add_collator.
 *
 * @snippet ex_extending.c add collator nocase
 *
 * @snippet ex_extending.c add collator prefix10
 */
struct __wt_collator {
	/*! Callback to compare keys.
	 *
	 * @param[out] cmp set to -1 if <code>key1 < key2</code>,
	 * 	0 if <code>key1 == key2</code>,
	 * 	1 if <code>key1 > key2</code>.
	 * @returns zero for success, non-zero to indicate an error.
	 *
	 * @snippet ex_all.c Implement WT_COLLATOR
	 *
	 * @snippet ex_extending.c case insensitive comparator
	 *
	 * @snippet ex_extending.c n character comparator
	 */
	int (*compare)(WT_COLLATOR *collator, WT_SESSION *session,
	    const WT_ITEM *key1, const WT_ITEM *key2, int *cmp);
};

/*!
 * The interface implemented by applications to provide custom compression.
 *
 * Compressors must implement the WT_COMPRESSOR interface: the
 * WT_COMPRESSOR::compress and WT_COMPRESSOR::decompress callbacks must be
 * specified, and WT_COMPRESSOR::pre_size is optional.  To build your own
 * compressor, use one of the compressors in \c ext/compressors as a template:
 * \c ext/nop_compress is a simple compressor that passes through data
 * unchanged, and is a reasonable starting point.
 *
 * Applications register their implementation with WiredTiger by calling
 * WT_CONNECTION::add_compressor.
 *
 * @snippet ex_all.c WT_COMPRESSOR register
 */
struct __wt_compressor {
	/*! Callback to compress a chunk of data.
	 *
	 * WT_COMPRESSOR::compress is given a source buffer and a destination
	 * buffer, by default of the same size.  If the callback can compress
	 * the buffer to a smaller size in the destination, it does so, sets
	 * the \c compression_failed return to 0 and returns 0.  If compression
	 * does not produce a smaller result, the callback sets the
	 * \c compression_failed return to 1 and returns 0. If another
	 * error occurs, it returns an errno or WiredTiger error code.
	 *
	 * On entry, \c src will point to memory, with the length of the memory
	 * in \c src_len.  After successful completion, the callback should
	 * return \c 0 and set \c result_lenp to the number of bytes required
	 * for the compressed representation.
	 *
	 * If compression would not shrink the data or the \c dst buffer is not
	 * large enough to hold the compressed data, the callback should set
	 * \c compression_failed to a non-zero value and return 0.
	 *
	 * @param[in] src the data to compress
	 * @param[in] src_len the length of the data to compress
	 * @param[in] dst the destination buffer
	 * @param[in] dst_len the length of the destination buffer
	 * @param[out] result_lenp the length of the compressed data
	 * @param[out] compression_failed non-zero if compression did not
	 * decrease the length of the data (compression may not have completed)
	 * @returns zero for success, non-zero to indicate an error.
	 *
	 * @snippet ex_all.c WT_COMPRESSOR compress
	 */
	int (*compress)(WT_COMPRESSOR *compressor, WT_SESSION *session,
	    uint8_t *src, size_t src_len,
	    uint8_t *dst, size_t dst_len,
	    size_t *result_lenp, int *compression_failed);

	/*! Callback to decompress a chunk of data.
	 *
	 * WT_COMPRESSOR::decompress is given a source buffer and a destination
	 * buffer.  The contents are switched from \c compress: the
	 * source buffer is the compressed value, and the destination buffer is
	 * sized to be the original size.  If the callback successfully
	 * decompresses the source buffer to the destination buffer, it returns
	 * 0.  If an error occurs, it returns an errno or WiredTiger error code.
	 * The source buffer that WT_COMPRESSOR::decompress is given may have a
	 * size that is rounded up from the size originally produced by
	 * WT_COMPRESSOR::compress, with the remainder of the buffer set to
	 * zeroes. Most compressors do not care about this difference if the
	 * size to be decompressed can be implicitly discovered from the
	 * compressed data.  If your compressor cares, you may need to allocate
	 * space for, and store, the actual size in the compressed buffer.  See
	 * the source code for the included snappy compressor for an example.
	 *
	 * On entry, \c src will point to memory, with the length of the memory
	 * in \c src_len.  After successful completion, the callback should
	 * return \c 0 and set \c result_lenp to the number of bytes required
	 * for the decompressed representation.
	 *
	 * If the \c dst buffer is not big enough to hold the decompressed
	 * data, the callback should return an error.
	 *
	 * @param[in] src the data to decompress
	 * @param[in] src_len the length of the data to decompress
	 * @param[in] dst the destination buffer
	 * @param[in] dst_len the length of the destination buffer
	 * @param[out] result_lenp the length of the decompressed data
	 * @returns zero for success, non-zero to indicate an error.
	 *
	 * @snippet ex_all.c WT_COMPRESSOR decompress
	 */
	int (*decompress)(WT_COMPRESSOR *compressor, WT_SESSION *session,
	    uint8_t *src, size_t src_len,
	    uint8_t *dst, size_t dst_len,
	    size_t *result_lenp);

	/*! Callback to size a destination buffer for compression
	 *
	 * WT_COMPRESSOR::pre_size is an optional callback that, given the
	 * source buffer and size, produces the size of the destination buffer
	 * to be given to WT_COMPRESSOR::compress.  This is useful for
	 * compressors that assume that the output buffer is sized for the
	 * worst case and thus no overrun checks are made.  If your compressor
	 * works like this, WT_COMPRESSOR::pre_size will need to be defined.
	 * See the source code for the snappy compressor for an example.
	 * However, if your compressor detects and avoids overruns against its
	 * target buffer, you will not need to define WT_COMPRESSOR::pre_size.
	 * When WT_COMPRESSOR::pre_size is set to NULL, the destination buffer
	 * is sized the same as the source buffer.  This is always sufficient,
	 * since a compression result that is larger than the source buffer is
	 * discarded by WiredTiger.
	 *
	 * If not NULL, this callback is called before each call to
	 * WT_COMPRESS::compress to determine the size of the destination
	 * buffer to provide.  If the callback is NULL, the destination
	 * buffer will be the same size as the source buffer.
	 *
	 * The callback should set \c result_lenp to a suitable buffer size
	 * for compression, typically the maximum length required by
	 * WT_COMPRESSOR::compress.
	 *
	 * This callback function is for compressors that require an output
	 * buffer larger than the source buffer (for example, that do not
	 * check for buffer overflow during compression).
	 *
	 * @param[in] src the data to compress
	 * @param[in] src_len the length of the data to compress
	 * @param[out] result_lenp the required destination buffer size
	 * @returns zero for success, non-zero to indicate an error.
	 *
	 * @snippet ex_all.c WT_COMPRESSOR presize
	 */
	int (*pre_size)(WT_COMPRESSOR *compressor, WT_SESSION *session,
	    uint8_t *src, size_t src_len, size_t *result_lenp);
};

/*!
 * Applications can extend WiredTiger by providing new implementations of the
 * WT_DATA_SOURCE class.  Each data source supports a different URI scheme for
 * data sources to WT_SESSION::create, WT_SESSION::open_cursor and related
 * methods.
 *
 * <b>Thread safety:</b> WiredTiger may invoke methods on the WT_DATA_SOURCE
 * interface from multiple threads concurrently.  It is the responsibility of
 * the implementation to protect any shared data.
 *
 * Applications register their implementation with WiredTiger by calling
 * WT_CONNECTION::add_data_source.
 *
 * @snippet ex_all.c WT_DATA_SOURCE register
 */
struct __wt_data_source {
	/*! Callback to create a new object.
	 *
	 * @snippet ex_all.c WT_DATA_SOURCE create
	 */
	int (*create)(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
	    const char *name, int exclusive, const char *config);

	/*! Callback to drop an object.
	 *
	 * @snippet ex_all.c WT_DATA_SOURCE drop
	 */
	int (*drop)(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
	    const char *name, const char *cfg[]);

	/*! Callback to initialize a cursor.
	 *
	 * @snippet ex_all.c WT_DATA_SOURCE open_cursor
	 */
	int (*open_cursor)(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
	    const char *obj, WT_CURSOR *owner, const char *cfg[],
	    WT_CURSOR **new_cursor);

	/*! Callback to rename an object.
	 *
	 * @snippet ex_all.c WT_DATA_SOURCE rename
	 */
	int (*rename)(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
	    const char *oldname, const char *newname, const char *cfg[]);

	/*! Callback to truncate an object.
	 *
	 * @snippet ex_all.c WT_DATA_SOURCE truncate
	 */
	int (*truncate)(WT_DATA_SOURCE *dsrc, WT_SESSION *session,
	    const char *name, const char *cfg[]);
};

/*!
 * The interface implemented by applications to provide custom extraction of
 * index keys or column group values.
 *
 * Applications register implementations with WiredTiger by calling
 * WT_CONNECTION::add_extractor.
 *
 * @snippet ex_all.c WT_EXTRACTOR register
 */
struct __wt_extractor {
	/*! Callback to extract a value for an index or column group.
	 *
	 * @errors
	 *
	 * @snippet ex_all.c WT_EXTRACTOR
	 */
	int (*extract)(WT_EXTRACTOR *extractor, WT_SESSION *session,
	    const WT_ITEM *key, const WT_ITEM *value,
	    WT_ITEM *result);
};

/*! Entry point to an extension, implemented by loadable modules.
 *
 * @param session the session handle
 * @param api entry points for WiredTiger functions exported to extensions
 * @param config the config string passed to WT_CONNECTION::load_extension
 * @errors
 */
extern int wiredtiger_extension_init(WT_SESSION *session,
    WT_EXTENSION_API *api, const char *config);

/*! @} */

/*******************************************
 * Statistic reference.
 *******************************************/
/*! @addtogroup wt
 * @{
 */
/*
 * DO NOT EDIT: automatically built by dist/api_stat.py.
 * Statistics section: BEGIN
 */

/*!
 * @name Connection statistics
 * @anchor statistics_keys
 * @anchor statistics_conn
 * Statistics are accessed through cursors with \c "statistics:" URIs.
 * Individual statistics can be queried through the cursor using the following
 * keys.  See @ref data_statistics for more information.
 * @{
 */
/*! blocks read from a file */
#define	WT_STAT_CONN_BLOCK_READ				0
/*! blocks written to a file */
#define	WT_STAT_CONN_BLOCK_WRITE			1
/*! cache: bytes currently held in the cache */
#define	WT_STAT_CONN_CACHE_BYTES_INUSE			2
/*! cache: maximum bytes configured */
#define	WT_STAT_CONN_CACHE_BYTES_MAX			3
/*! cache: pages selected for eviction not evicted because of a hazard
 * reference */
#define	WT_STAT_CONN_CACHE_EVICT_HAZARD			4
/*! cache: internal pages evicted */
#define	WT_STAT_CONN_CACHE_EVICT_INTERNAL		5
/*! cache: modified pages evicted */
#define	WT_STAT_CONN_CACHE_EVICT_MODIFIED		6
/*! cache: eviction server unable to reach eviction goal */
#define	WT_STAT_CONN_CACHE_EVICT_SLOW			7
/*! cache: unmodified pages evicted */
#define	WT_STAT_CONN_CACHE_EVICT_UNMODIFIED		8
/*! cache: pages currently held in the cache */
#define	WT_STAT_CONN_CACHE_PAGES_INUSE			9
/*! checkpoints */
#define	WT_STAT_CONN_CHECKPOINT				10
/*! condition wait calls */
#define	WT_STAT_CONN_COND_WAIT				11
/*! files currently open */
#define	WT_STAT_CONN_FILE_OPEN				12
/*! total memory allocations */
#define	WT_STAT_CONN_MEMALLOC				13
/*! total memory frees */
#define	WT_STAT_CONN_MEMFREE				14
/*! rwlock readlock calls */
#define	WT_STAT_CONN_RWLOCK_RDLOCK			15
/*! rwlock writelock calls */
#define	WT_STAT_CONN_RWLOCK_WRLOCK			16
/*! total read I/Os */
#define	WT_STAT_CONN_TOTAL_READ_IO			17
/*! total write I/Os */
#define	WT_STAT_CONN_TOTAL_WRITE_IO			18
/*! ancient transactions */
#define	WT_STAT_CONN_TXN_ANCIENT			19
/*! transactions */
#define	WT_STAT_CONN_TXN_BEGIN				20
/*! transactions committed */
#define	WT_STAT_CONN_TXN_COMMIT				21
/*! transaction failures due to cache overflow */
#define	WT_STAT_CONN_TXN_FAIL_CACHE			22
/*! transactions rolled-back */
#define	WT_STAT_CONN_TXN_ROLLBACK			23

/*!
 * @}
 * @name Statistics for data sources
 * @anchor statistics_dsrc
 * @{
 */
/*! block allocations */
#define	WT_STAT_DSRC_BLOCK_ALLOC			0
/*! block allocations required file extension */
#define	WT_STAT_DSRC_BLOCK_EXTEND			1
/*! block frees */
#define	WT_STAT_DSRC_BLOCK_FREE				2
/*! Number of Bloom filters in the LSM tree */
#define	WT_STAT_DSRC_BLOOM_COUNT			3
/*! Number of Bloom filter false positives */
#define	WT_STAT_DSRC_BLOOM_FALSE_POSITIVE		4
/*! Number of Bloom filter hits */
#define	WT_STAT_DSRC_BLOOM_HIT				5
/*! Number of Bloom filter misses */
#define	WT_STAT_DSRC_BLOOM_MISS				6
/*! Number of Bloom pages evicted from cache */
#define	WT_STAT_DSRC_BLOOM_PAGE_EVICT			7
/*! Number of Bloom pages read into cache */
#define	WT_STAT_DSRC_BLOOM_PAGE_READ			8
/*! Total size of Bloom filters */
#define	WT_STAT_DSRC_BLOOM_SIZE				9
/*! checkpoint size */
#define	WT_STAT_DSRC_CKPT_SIZE				10
/*! cursor-inserts */
#define	WT_STAT_DSRC_CURSOR_INSERT			11
/*! cursor-read */
#define	WT_STAT_DSRC_CURSOR_READ			12
/*! cursor-read-near */
#define	WT_STAT_DSRC_CURSOR_READ_NEAR			13
/*! cursor-read-next */
#define	WT_STAT_DSRC_CURSOR_READ_NEXT			14
/*! cursor-read-prev */
#define	WT_STAT_DSRC_CURSOR_READ_PREV			15
/*! cursor-removes */
#define	WT_STAT_DSRC_CURSOR_REMOVE			16
/*! cursor-resets */
#define	WT_STAT_DSRC_CURSOR_RESET			17
/*! cursor-updates */
#define	WT_STAT_DSRC_CURSOR_UPDATE			18
/*! total entries */
#define	WT_STAT_DSRC_ENTRIES				19
/*! page size allocation unit */
#define	WT_STAT_DSRC_FILE_ALLOCSIZE			20
/*! bulk-loaded entries */
#define	WT_STAT_DSRC_FILE_BULK_LOADED			21
/*! pages rewritten by compaction */
#define	WT_STAT_DSRC_FILE_COMPACT_REWRITE		22
/*! fixed-record size */
#define	WT_STAT_DSRC_FILE_FIXED_LEN			23
/*! magic number */
#define	WT_STAT_DSRC_FILE_MAGIC				24
/*! major version number */
#define	WT_STAT_DSRC_FILE_MAJOR				25
/*! maximum internal page item size */
#define	WT_STAT_DSRC_FILE_MAXINTLITEM			26
/*! maximum internal page size */
#define	WT_STAT_DSRC_FILE_MAXINTLPAGE			27
/*! maximum leaf page item size */
#define	WT_STAT_DSRC_FILE_MAXLEAFITEM			28
/*! maximum leaf page size */
#define	WT_STAT_DSRC_FILE_MAXLEAFPAGE			29
/*! minor version number */
#define	WT_STAT_DSRC_FILE_MINOR				30
/*! file size */
#define	WT_STAT_DSRC_FILE_SIZE				31
/*! Number of chunks in the LSM tree */
#define	WT_STAT_DSRC_LSM_CHUNK_COUNT			32
/*! Highest merge generation in the LSM tree */
#define	WT_STAT_DSRC_LSM_GENERATION_MAX			33
/*! Number of queries that could have benefited from a Bloom filter that
 * did not exist */
#define	WT_STAT_DSRC_LSM_LOOKUP_NO_BLOOM		34
/*! overflow pages */
#define	WT_STAT_DSRC_OVERFLOW_PAGE			35
/*! overflow pages read into cache */
#define	WT_STAT_DSRC_OVERFLOW_READ			36
/*! overflow values cached in memory */
#define	WT_STAT_DSRC_OVERFLOW_VALUE_CACHE		37
/*! column-store deleted values */
#define	WT_STAT_DSRC_PAGE_COL_DELETED			38
/*! column-store fixed-size leaf pages */
#define	WT_STAT_DSRC_PAGE_COL_FIX			39
/*! column-store internal pages */
#define	WT_STAT_DSRC_PAGE_COL_INT			40
/*! column-store variable-size leaf pages */
#define	WT_STAT_DSRC_PAGE_COL_VAR			41
/*! pages evicted from the data source */
#define	WT_STAT_DSRC_PAGE_EVICT				42
/*! pages that were selected for eviction that could not be evicted */
#define	WT_STAT_DSRC_PAGE_EVICT_FAIL			43
/*! pages read into cache */
#define	WT_STAT_DSRC_PAGE_READ				44
/*! row-store internal pages */
#define	WT_STAT_DSRC_PAGE_ROW_INT			45
/*! row-store leaf pages */
#define	WT_STAT_DSRC_PAGE_ROW_LEAF			46
/*! pages written from cache */
#define	WT_STAT_DSRC_PAGE_WRITE				47
/*! reconcile: dictionary match */
#define	WT_STAT_DSRC_REC_DICTIONARY			48
/*! reconciliation unable to acquire hazard reference */
#define	WT_STAT_DSRC_REC_HAZARD				49
/*! reconciliation overflow key */
#define	WT_STAT_DSRC_REC_OVFL_KEY			50
/*! reconciliation overflow value */
#define	WT_STAT_DSRC_REC_OVFL_VALUE			51
/*! pages deleted */
#define	WT_STAT_DSRC_REC_PAGE_DELETE			52
/*! deleted or temporary pages merged */
#define	WT_STAT_DSRC_REC_PAGE_MERGE			53
/*! internal pages split */
#define	WT_STAT_DSRC_REC_SPLIT_INTL			54
/*! leaf pages split */
#define	WT_STAT_DSRC_REC_SPLIT_LEAF			55
/*! pages written */
#define	WT_STAT_DSRC_REC_WRITTEN			56
/*! update conflicts */
#define	WT_STAT_DSRC_TXN_UPDATE_CONFLICT		57
/*! write generation conflicts */
#define	WT_STAT_DSRC_TXN_WRITE_CONFLICT			58
/*! @} */
/*
 * Statistics section: END
 * DO NOT EDIT: automatically built by dist/api_stat.py.
 */
/*! @} */
/*! @} */

#undef __F

#if defined(__cplusplus)
}
#endif
#endif /* __WIREDTIGER_H_ */