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
pub const MDBX_VERSION_MAJOR: ::libc::c_uint = 0;
pub const MDBX_VERSION_MINOR: ::libc::c_uint = 11;
pub const MDBX_LOCKNAME: &[u8; 10usize] = b"/mdbx.lck\0";
pub const MDBX_DATANAME: &[u8; 10usize] = b"/mdbx.dat\0";
pub const MDBX_LOCK_SUFFIX: &[u8; 5usize] = b"-lck\0";
pub type va_list = __builtin_va_list;
pub type __uint8_t = ::libc::c_uchar;
pub type __uint16_t = ::libc::c_ushort;
pub type __int32_t = ::libc::c_int;
pub type __uint32_t = ::libc::c_uint;
pub type __int64_t = ::libc::c_longlong;
pub type __uint64_t = ::libc::c_ulonglong;
pub type __mode_t = ::libc::c_uint;
pub type __pid_t = ::libc::c_int;
pub type pid_t = __pid_t;
pub type pthread_t = ::libc::c_ulong;
pub type mode_t = __mode_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
    pub iov_base: *mut ::libc::c_void,
    pub iov_len: usize,
}
pub type mdbx_filehandle_t = ::libc::c_int;
pub type mdbx_pid_t = pid_t;
pub type mdbx_tid_t = pthread_t;
pub type mdbx_mode_t = mode_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_version_info {
    pub major: u8,
    pub minor: u8,
    pub release: u16,
    pub revision: u32,
    pub git: MDBX_version_info__bindgen_ty_1,
    pub sourcery: *const ::libc::c_char,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_version_info__bindgen_ty_1 {
    pub datetime: *const ::libc::c_char,
    pub tree: *const ::libc::c_char,
    pub commit: *const ::libc::c_char,
    pub describe: *const ::libc::c_char,
}
extern "C" {
    pub static mdbx_version: MDBX_version_info;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_build_info {
    pub datetime: *const ::libc::c_char,
    pub target: *const ::libc::c_char,
    pub options: *const ::libc::c_char,
    pub compiler: *const ::libc::c_char,
    pub flags: *const ::libc::c_char,
}
extern "C" {
    pub static mdbx_build: MDBX_build_info;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_env {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_txn {
    _unused: [u8; 0],
}
pub type MDBX_dbi = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_cursor {
    _unused: [u8; 0],
}
pub type MDBX_val = iovec;
impl MDBX_constants {
    pub const MDBX_MAX_DBI: MDBX_constants = MDBX_constants(32765);
}
impl MDBX_constants {
    pub const MDBX_MAXDATASIZE: MDBX_constants = MDBX_constants(2147418112);
}
impl MDBX_constants {
    pub const MDBX_MIN_PAGESIZE: MDBX_constants = MDBX_constants(256);
}
impl MDBX_constants {
    pub const MDBX_MAX_PAGESIZE: MDBX_constants = MDBX_constants(65536);
}
impl ::std::ops::BitOr<MDBX_constants> for MDBX_constants {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_constants(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_constants {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_constants) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_constants> for MDBX_constants {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_constants(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_constants {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_constants) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_constants(pub ::libc::c_uint);
impl MDBX_log_level_t {
    pub const MDBX_LOG_FATAL: MDBX_log_level_t = MDBX_log_level_t(0);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_ERROR: MDBX_log_level_t = MDBX_log_level_t(1);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_WARN: MDBX_log_level_t = MDBX_log_level_t(2);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_NOTICE: MDBX_log_level_t = MDBX_log_level_t(3);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_VERBOSE: MDBX_log_level_t = MDBX_log_level_t(4);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_DEBUG: MDBX_log_level_t = MDBX_log_level_t(5);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_TRACE: MDBX_log_level_t = MDBX_log_level_t(6);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_EXTRA: MDBX_log_level_t = MDBX_log_level_t(7);
}
impl MDBX_log_level_t {
    pub const MDBX_LOG_DONTCHANGE: MDBX_log_level_t = MDBX_log_level_t(-1);
}
impl ::std::ops::BitOr<MDBX_log_level_t> for MDBX_log_level_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_log_level_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_log_level_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_log_level_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_log_level_t> for MDBX_log_level_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_log_level_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_log_level_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_log_level_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_log_level_t(pub ::libc::c_int);
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_NONE: MDBX_debug_flags_t = MDBX_debug_flags_t(0);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_ASSERT: MDBX_debug_flags_t = MDBX_debug_flags_t(1);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_AUDIT: MDBX_debug_flags_t = MDBX_debug_flags_t(2);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_JITTER: MDBX_debug_flags_t = MDBX_debug_flags_t(4);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_DUMP: MDBX_debug_flags_t = MDBX_debug_flags_t(8);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_LEGACY_MULTIOPEN: MDBX_debug_flags_t = MDBX_debug_flags_t(16);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_LEGACY_OVERLAP: MDBX_debug_flags_t = MDBX_debug_flags_t(32);
}
impl MDBX_debug_flags_t {
    pub const MDBX_DBG_DONTCHANGE: MDBX_debug_flags_t = MDBX_debug_flags_t(-1);
}
impl ::std::ops::BitOr<MDBX_debug_flags_t> for MDBX_debug_flags_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_debug_flags_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_debug_flags_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_debug_flags_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_debug_flags_t> for MDBX_debug_flags_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_debug_flags_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_debug_flags_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_debug_flags_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_debug_flags_t(pub ::libc::c_int);
pub type MDBX_debug_func = ::std::option::Option<
    unsafe extern "C" fn(
        loglevel: MDBX_log_level_t,
        function: *const ::libc::c_char,
        line: ::libc::c_int,
        fmt: *const ::libc::c_char,
        args: va_list,
    ),
>;
extern "C" {
    pub fn mdbx_setup_debug(
        log_level: MDBX_log_level_t,
        debug_flags: MDBX_debug_flags_t,
        logger: MDBX_debug_func,
    ) -> ::libc::c_int;
}
pub type MDBX_assert_func = ::std::option::Option<
    unsafe extern "C" fn(
        env: *const MDBX_env,
        msg: *const ::libc::c_char,
        function: *const ::libc::c_char,
        line: ::libc::c_uint,
    ),
>;
extern "C" {
    pub fn mdbx_env_set_assert(env: *mut MDBX_env, func: MDBX_assert_func) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_dump_val(
        key: *const MDBX_val,
        buf: *mut ::libc::c_char,
        bufsize: usize,
    ) -> *const ::libc::c_char;
}
extern "C" {
    pub fn mdbx_panic(fmt: *const ::libc::c_char, ...);
}
impl MDBX_env_flags_t {
    pub const MDBX_ENV_DEFAULTS: MDBX_env_flags_t = MDBX_env_flags_t(0);
}
impl MDBX_env_flags_t {
    pub const MDBX_NOSUBDIR: MDBX_env_flags_t = MDBX_env_flags_t(16384);
}
impl MDBX_env_flags_t {
    pub const MDBX_RDONLY: MDBX_env_flags_t = MDBX_env_flags_t(131072);
}
impl MDBX_env_flags_t {
    pub const MDBX_EXCLUSIVE: MDBX_env_flags_t = MDBX_env_flags_t(4194304);
}
impl MDBX_env_flags_t {
    pub const MDBX_ACCEDE: MDBX_env_flags_t = MDBX_env_flags_t(1073741824);
}
impl MDBX_env_flags_t {
    pub const MDBX_WRITEMAP: MDBX_env_flags_t = MDBX_env_flags_t(524288);
}
impl MDBX_env_flags_t {
    pub const MDBX_NOTLS: MDBX_env_flags_t = MDBX_env_flags_t(2097152);
}
impl MDBX_env_flags_t {
    pub const MDBX_NORDAHEAD: MDBX_env_flags_t = MDBX_env_flags_t(8388608);
}
impl MDBX_env_flags_t {
    pub const MDBX_NOMEMINIT: MDBX_env_flags_t = MDBX_env_flags_t(16777216);
}
impl MDBX_env_flags_t {
    pub const MDBX_COALESCE: MDBX_env_flags_t = MDBX_env_flags_t(33554432);
}
impl MDBX_env_flags_t {
    pub const MDBX_LIFORECLAIM: MDBX_env_flags_t = MDBX_env_flags_t(67108864);
}
impl MDBX_env_flags_t {
    pub const MDBX_PAGEPERTURB: MDBX_env_flags_t = MDBX_env_flags_t(134217728);
}
impl MDBX_env_flags_t {
    pub const MDBX_SYNC_DURABLE: MDBX_env_flags_t = MDBX_env_flags_t(0);
}
impl MDBX_env_flags_t {
    pub const MDBX_NOMETASYNC: MDBX_env_flags_t = MDBX_env_flags_t(262144);
}
impl MDBX_env_flags_t {
    pub const MDBX_SAFE_NOSYNC: MDBX_env_flags_t = MDBX_env_flags_t(65536);
}
impl MDBX_env_flags_t {
    pub const MDBX_MAPASYNC: MDBX_env_flags_t = MDBX_env_flags_t(65536);
}
impl MDBX_env_flags_t {
    pub const MDBX_UTTERLY_NOSYNC: MDBX_env_flags_t = MDBX_env_flags_t(1114112);
}
impl ::std::ops::BitOr<MDBX_env_flags_t> for MDBX_env_flags_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_env_flags_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_env_flags_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_env_flags_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_env_flags_t> for MDBX_env_flags_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_env_flags_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_env_flags_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_env_flags_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_env_flags_t(pub ::libc::c_uint);
impl MDBX_txn_flags_t {
    pub const MDBX_TXN_READWRITE: MDBX_txn_flags_t = MDBX_txn_flags_t(0);
}
impl MDBX_txn_flags_t {
    pub const MDBX_TXN_RDONLY: MDBX_txn_flags_t = MDBX_txn_flags_t(131072);
}
impl MDBX_txn_flags_t {
    pub const MDBX_TXN_RDONLY_PREPARE: MDBX_txn_flags_t = MDBX_txn_flags_t(16908288);
}
impl MDBX_txn_flags_t {
    pub const MDBX_TXN_TRY: MDBX_txn_flags_t = MDBX_txn_flags_t(268435456);
}
impl MDBX_txn_flags_t {
    pub const MDBX_TXN_NOMETASYNC: MDBX_txn_flags_t = MDBX_txn_flags_t(262144);
}
impl MDBX_txn_flags_t {
    pub const MDBX_TXN_NOSYNC: MDBX_txn_flags_t = MDBX_txn_flags_t(65536);
}
impl ::std::ops::BitOr<MDBX_txn_flags_t> for MDBX_txn_flags_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_txn_flags_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_txn_flags_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_txn_flags_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_txn_flags_t> for MDBX_txn_flags_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_txn_flags_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_txn_flags_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_txn_flags_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_txn_flags_t(pub ::libc::c_uint);
impl MDBX_db_flags_t {
    pub const MDBX_DB_DEFAULTS: MDBX_db_flags_t = MDBX_db_flags_t(0);
}
impl MDBX_db_flags_t {
    pub const MDBX_REVERSEKEY: MDBX_db_flags_t = MDBX_db_flags_t(2);
}
impl MDBX_db_flags_t {
    pub const MDBX_DUPSORT: MDBX_db_flags_t = MDBX_db_flags_t(4);
}
impl MDBX_db_flags_t {
    pub const MDBX_INTEGERKEY: MDBX_db_flags_t = MDBX_db_flags_t(8);
}
impl MDBX_db_flags_t {
    pub const MDBX_DUPFIXED: MDBX_db_flags_t = MDBX_db_flags_t(16);
}
impl MDBX_db_flags_t {
    pub const MDBX_INTEGERDUP: MDBX_db_flags_t = MDBX_db_flags_t(32);
}
impl MDBX_db_flags_t {
    pub const MDBX_REVERSEDUP: MDBX_db_flags_t = MDBX_db_flags_t(64);
}
impl MDBX_db_flags_t {
    pub const MDBX_CREATE: MDBX_db_flags_t = MDBX_db_flags_t(262144);
}
impl MDBX_db_flags_t {
    pub const MDBX_DB_ACCEDE: MDBX_db_flags_t = MDBX_db_flags_t(1073741824);
}
impl ::std::ops::BitOr<MDBX_db_flags_t> for MDBX_db_flags_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_db_flags_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_db_flags_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_db_flags_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_db_flags_t> for MDBX_db_flags_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_db_flags_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_db_flags_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_db_flags_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_db_flags_t(pub ::libc::c_uint);
impl MDBX_put_flags_t {
    pub const MDBX_UPSERT: MDBX_put_flags_t = MDBX_put_flags_t(0);
}
impl MDBX_put_flags_t {
    pub const MDBX_NOOVERWRITE: MDBX_put_flags_t = MDBX_put_flags_t(16);
}
impl MDBX_put_flags_t {
    pub const MDBX_NODUPDATA: MDBX_put_flags_t = MDBX_put_flags_t(32);
}
impl MDBX_put_flags_t {
    pub const MDBX_CURRENT: MDBX_put_flags_t = MDBX_put_flags_t(64);
}
impl MDBX_put_flags_t {
    pub const MDBX_ALLDUPS: MDBX_put_flags_t = MDBX_put_flags_t(128);
}
impl MDBX_put_flags_t {
    pub const MDBX_RESERVE: MDBX_put_flags_t = MDBX_put_flags_t(65536);
}
impl MDBX_put_flags_t {
    pub const MDBX_APPEND: MDBX_put_flags_t = MDBX_put_flags_t(131072);
}
impl MDBX_put_flags_t {
    pub const MDBX_APPENDDUP: MDBX_put_flags_t = MDBX_put_flags_t(262144);
}
impl MDBX_put_flags_t {
    pub const MDBX_MULTIPLE: MDBX_put_flags_t = MDBX_put_flags_t(524288);
}
impl ::std::ops::BitOr<MDBX_put_flags_t> for MDBX_put_flags_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_put_flags_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_put_flags_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_put_flags_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_put_flags_t> for MDBX_put_flags_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_put_flags_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_put_flags_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_put_flags_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_put_flags_t(pub ::libc::c_uint);
impl MDBX_copy_flags_t {
    pub const MDBX_CP_DEFAULTS: MDBX_copy_flags_t = MDBX_copy_flags_t(0);
}
impl MDBX_copy_flags_t {
    pub const MDBX_CP_COMPACT: MDBX_copy_flags_t = MDBX_copy_flags_t(1);
}
impl MDBX_copy_flags_t {
    pub const MDBX_CP_FORCE_DYNAMIC_SIZE: MDBX_copy_flags_t = MDBX_copy_flags_t(2);
}
impl ::std::ops::BitOr<MDBX_copy_flags_t> for MDBX_copy_flags_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_copy_flags_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_copy_flags_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_copy_flags_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_copy_flags_t> for MDBX_copy_flags_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_copy_flags_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_copy_flags_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_copy_flags_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_copy_flags_t(pub ::libc::c_uint);
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum MDBX_cursor_op {
    MDBX_FIRST = 0,
    MDBX_FIRST_DUP = 1,
    MDBX_GET_BOTH = 2,
    MDBX_GET_BOTH_RANGE = 3,
    MDBX_GET_CURRENT = 4,
    MDBX_GET_MULTIPLE = 5,
    MDBX_LAST = 6,
    MDBX_LAST_DUP = 7,
    MDBX_NEXT = 8,
    MDBX_NEXT_DUP = 9,
    MDBX_NEXT_MULTIPLE = 10,
    MDBX_NEXT_NODUP = 11,
    MDBX_PREV = 12,
    MDBX_PREV_DUP = 13,
    MDBX_PREV_NODUP = 14,
    MDBX_SET = 15,
    MDBX_SET_KEY = 16,
    MDBX_SET_RANGE = 17,
    MDBX_PREV_MULTIPLE = 18,
    MDBX_SET_LOWERBOUND = 19,
    MDBX_SET_UPPERBOUND = 20,
    MDBX_SET_LOWERBOUND_REV = 21,
}
impl MDBX_error_t {
    pub const MDBX_SUCCESS: MDBX_error_t = MDBX_error_t(0);
}
impl MDBX_error_t {
    pub const MDBX_RESULT_FALSE: MDBX_error_t = MDBX_error_t(0);
}
impl MDBX_error_t {
    pub const MDBX_RESULT_TRUE: MDBX_error_t = MDBX_error_t(-1);
}
impl MDBX_error_t {
    pub const MDBX_KEYEXIST: MDBX_error_t = MDBX_error_t(-30799);
}
impl MDBX_error_t {
    pub const MDBX_FIRST_LMDB_ERRCODE: MDBX_error_t = MDBX_error_t(-30799);
}
impl MDBX_error_t {
    pub const MDBX_NOTFOUND: MDBX_error_t = MDBX_error_t(-30798);
}
impl MDBX_error_t {
    pub const MDBX_PAGE_NOTFOUND: MDBX_error_t = MDBX_error_t(-30797);
}
impl MDBX_error_t {
    pub const MDBX_CORRUPTED: MDBX_error_t = MDBX_error_t(-30796);
}
impl MDBX_error_t {
    pub const MDBX_PANIC: MDBX_error_t = MDBX_error_t(-30795);
}
impl MDBX_error_t {
    pub const MDBX_VERSION_MISMATCH: MDBX_error_t = MDBX_error_t(-30794);
}
impl MDBX_error_t {
    pub const MDBX_INVALID: MDBX_error_t = MDBX_error_t(-30793);
}
impl MDBX_error_t {
    pub const MDBX_MAP_FULL: MDBX_error_t = MDBX_error_t(-30792);
}
impl MDBX_error_t {
    pub const MDBX_DBS_FULL: MDBX_error_t = MDBX_error_t(-30791);
}
impl MDBX_error_t {
    pub const MDBX_READERS_FULL: MDBX_error_t = MDBX_error_t(-30790);
}
impl MDBX_error_t {
    pub const MDBX_TXN_FULL: MDBX_error_t = MDBX_error_t(-30788);
}
impl MDBX_error_t {
    pub const MDBX_CURSOR_FULL: MDBX_error_t = MDBX_error_t(-30787);
}
impl MDBX_error_t {
    pub const MDBX_PAGE_FULL: MDBX_error_t = MDBX_error_t(-30786);
}
impl MDBX_error_t {
    pub const MDBX_UNABLE_EXTEND_MAPSIZE: MDBX_error_t = MDBX_error_t(-30785);
}
impl MDBX_error_t {
    pub const MDBX_INCOMPATIBLE: MDBX_error_t = MDBX_error_t(-30784);
}
impl MDBX_error_t {
    pub const MDBX_BAD_RSLOT: MDBX_error_t = MDBX_error_t(-30783);
}
impl MDBX_error_t {
    pub const MDBX_BAD_TXN: MDBX_error_t = MDBX_error_t(-30782);
}
impl MDBX_error_t {
    pub const MDBX_BAD_VALSIZE: MDBX_error_t = MDBX_error_t(-30781);
}
impl MDBX_error_t {
    pub const MDBX_BAD_DBI: MDBX_error_t = MDBX_error_t(-30780);
}
impl MDBX_error_t {
    pub const MDBX_PROBLEM: MDBX_error_t = MDBX_error_t(-30779);
}
impl MDBX_error_t {
    pub const MDBX_LAST_LMDB_ERRCODE: MDBX_error_t = MDBX_error_t(-30779);
}
impl MDBX_error_t {
    pub const MDBX_BUSY: MDBX_error_t = MDBX_error_t(-30778);
}
impl MDBX_error_t {
    pub const MDBX_FIRST_ADDED_ERRCODE: MDBX_error_t = MDBX_error_t(-30778);
}
impl MDBX_error_t {
    pub const MDBX_EMULTIVAL: MDBX_error_t = MDBX_error_t(-30421);
}
impl MDBX_error_t {
    pub const MDBX_EBADSIGN: MDBX_error_t = MDBX_error_t(-30420);
}
impl MDBX_error_t {
    pub const MDBX_WANNA_RECOVERY: MDBX_error_t = MDBX_error_t(-30419);
}
impl MDBX_error_t {
    pub const MDBX_EKEYMISMATCH: MDBX_error_t = MDBX_error_t(-30418);
}
impl MDBX_error_t {
    pub const MDBX_TOO_LARGE: MDBX_error_t = MDBX_error_t(-30417);
}
impl MDBX_error_t {
    pub const MDBX_THREAD_MISMATCH: MDBX_error_t = MDBX_error_t(-30416);
}
impl MDBX_error_t {
    pub const MDBX_TXN_OVERLAPPING: MDBX_error_t = MDBX_error_t(-30415);
}
impl MDBX_error_t {
    pub const MDBX_LAST_ADDED_ERRCODE: MDBX_error_t = MDBX_error_t(-30415);
}
impl MDBX_error_t {
    pub const MDBX_ENODATA: MDBX_error_t = MDBX_error_t(61);
}
impl MDBX_error_t {
    pub const MDBX_EINVAL: MDBX_error_t = MDBX_error_t(22);
}
impl MDBX_error_t {
    pub const MDBX_EACCESS: MDBX_error_t = MDBX_error_t(13);
}
impl MDBX_error_t {
    pub const MDBX_ENOMEM: MDBX_error_t = MDBX_error_t(12);
}
impl MDBX_error_t {
    pub const MDBX_EROFS: MDBX_error_t = MDBX_error_t(30);
}
impl MDBX_error_t {
    pub const MDBX_ENOSYS: MDBX_error_t = MDBX_error_t(38);
}
impl MDBX_error_t {
    pub const MDBX_EIO: MDBX_error_t = MDBX_error_t(5);
}
impl MDBX_error_t {
    pub const MDBX_EPERM: MDBX_error_t = MDBX_error_t(1);
}
impl MDBX_error_t {
    pub const MDBX_EINTR: MDBX_error_t = MDBX_error_t(4);
}
impl MDBX_error_t {
    pub const MDBX_ENOFILE: MDBX_error_t = MDBX_error_t(2);
}
impl MDBX_error_t {
    pub const MDBX_EREMOTE: MDBX_error_t = MDBX_error_t(15);
}
impl ::std::ops::BitOr<MDBX_error_t> for MDBX_error_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_error_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_error_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_error_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_error_t> for MDBX_error_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_error_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_error_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_error_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_error_t(pub ::libc::c_int);
extern "C" {
    pub fn mdbx_strerror(errnum: ::libc::c_int) -> *const ::libc::c_char;
}
extern "C" {
    pub fn mdbx_strerror_r(
        errnum: ::libc::c_int,
        buf: *mut ::libc::c_char,
        buflen: usize,
    ) -> *const ::libc::c_char;
}
extern "C" {
    pub fn mdbx_liberr2str(errnum: ::libc::c_int) -> *const ::libc::c_char;
}
extern "C" {
    pub fn mdbx_env_create(penv: *mut *mut MDBX_env) -> ::libc::c_int;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum MDBX_option_t {
    MDBX_opt_max_db = 0,
    MDBX_opt_max_readers = 1,
    MDBX_opt_sync_bytes = 2,
    MDBX_opt_sync_period = 3,
    MDBX_opt_rp_augment_limit = 4,
    MDBX_opt_loose_limit = 5,
    MDBX_opt_dp_reserve_limit = 6,
    MDBX_opt_txn_dp_limit = 7,
    MDBX_opt_txn_dp_initial = 8,
    MDBX_opt_spill_max_denominator = 9,
    MDBX_opt_spill_min_denominator = 10,
    MDBX_opt_spill_parent4child_denominator = 11,
    MDBX_opt_merge_threshold_16dot16_percent = 12,
}
extern "C" {
    pub fn mdbx_env_set_option(
        env: *mut MDBX_env,
        option: MDBX_option_t,
        value: u64,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_option(
        env: *const MDBX_env,
        option: MDBX_option_t,
        pvalue: *mut u64,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_open(
        env: *mut MDBX_env,
        pathname: *const ::libc::c_char,
        flags: MDBX_env_flags_t,
        mode: mdbx_mode_t,
    ) -> ::libc::c_int;
}
impl MDBX_env_delete_mode_t {
    pub const MDBX_ENV_JUST_DELETE: MDBX_env_delete_mode_t = MDBX_env_delete_mode_t(0);
}
impl MDBX_env_delete_mode_t {
    pub const MDBX_ENV_ENSURE_UNUSED: MDBX_env_delete_mode_t = MDBX_env_delete_mode_t(1);
}
impl MDBX_env_delete_mode_t {
    pub const MDBX_ENV_WAIT_FOR_UNUSED: MDBX_env_delete_mode_t = MDBX_env_delete_mode_t(2);
}
impl ::std::ops::BitOr<MDBX_env_delete_mode_t> for MDBX_env_delete_mode_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_env_delete_mode_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_env_delete_mode_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_env_delete_mode_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_env_delete_mode_t> for MDBX_env_delete_mode_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_env_delete_mode_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_env_delete_mode_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_env_delete_mode_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_env_delete_mode_t(pub ::libc::c_uint);
extern "C" {
    pub fn mdbx_env_delete(
        pathname: *const ::libc::c_char,
        mode: MDBX_env_delete_mode_t,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_copy(
        env: *mut MDBX_env,
        dest: *const ::libc::c_char,
        flags: MDBX_copy_flags_t,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_copy2fd(
        env: *mut MDBX_env,
        fd: mdbx_filehandle_t,
        flags: MDBX_copy_flags_t,
    ) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_stat {
    pub ms_psize: u32,
    pub ms_depth: u32,
    pub ms_branch_pages: u64,
    pub ms_leaf_pages: u64,
    pub ms_overflow_pages: u64,
    pub ms_entries: u64,
    pub ms_mod_txnid: u64,
}
extern "C" {
    pub fn mdbx_env_stat_ex(
        env: *const MDBX_env,
        txn: *const MDBX_txn,
        stat: *mut MDBX_stat,
        bytes: usize,
    ) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo {
    pub mi_geo: MDBX_envinfo__bindgen_ty_1,
    pub mi_mapsize: u64,
    pub mi_last_pgno: u64,
    pub mi_recent_txnid: u64,
    pub mi_latter_reader_txnid: u64,
    pub mi_self_latter_reader_txnid: u64,
    pub mi_meta0_txnid: u64,
    pub mi_meta0_sign: u64,
    pub mi_meta1_txnid: u64,
    pub mi_meta1_sign: u64,
    pub mi_meta2_txnid: u64,
    pub mi_meta2_sign: u64,
    pub mi_maxreaders: u32,
    pub mi_numreaders: u32,
    pub mi_dxb_pagesize: u32,
    pub mi_sys_pagesize: u32,
    pub mi_bootid: MDBX_envinfo__bindgen_ty_2,
    pub mi_unsync_volume: u64,
    pub mi_autosync_threshold: u64,
    pub mi_since_sync_seconds16dot16: u32,
    pub mi_autosync_period_seconds16dot16: u32,
    pub mi_since_reader_check_seconds16dot16: u32,
    pub mi_mode: u32,
    pub mi_pgop_stat: MDBX_envinfo__bindgen_ty_3,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_1 {
    pub lower: u64,
    pub upper: u64,
    pub current: u64,
    pub shrink: u64,
    pub grow: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_2 {
    pub current: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
    pub meta0: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
    pub meta1: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
    pub meta2: MDBX_envinfo__bindgen_ty_2__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_2__bindgen_ty_1 {
    pub x: u64,
    pub y: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_envinfo__bindgen_ty_3 {
    pub newly: u64,
    pub cow: u64,
    pub clone: u64,
    pub split: u64,
    pub merge: u64,
    pub spill: u64,
    pub unspill: u64,
    pub wops: u64,
}
extern "C" {
    pub fn mdbx_env_info_ex(
        env: *const MDBX_env,
        txn: *const MDBX_txn,
        info: *mut MDBX_envinfo,
        bytes: usize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_sync_ex(env: *mut MDBX_env, force: bool, nonblock: bool) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_close_ex(env: *mut MDBX_env, dont_sync: bool) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_set_flags(
        env: *mut MDBX_env,
        flags: MDBX_env_flags_t,
        onoff: bool,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_flags(env: *const MDBX_env, flags: *mut ::libc::c_uint) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_path(
        env: *const MDBX_env,
        dest: *mut *const ::libc::c_char,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_fd(env: *const MDBX_env, fd: *mut mdbx_filehandle_t) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_set_geometry(
        env: *mut MDBX_env,
        size_lower: isize,
        size_now: isize,
        size_upper: isize,
        growth_step: isize,
        shrink_threshold: isize,
        pagesize: isize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_is_readahead_reasonable(volume: usize, redundancy: isize) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_limits_dbsize_min(pagesize: isize) -> isize;
}
extern "C" {
    pub fn mdbx_limits_dbsize_max(pagesize: isize) -> isize;
}
extern "C" {
    pub fn mdbx_limits_keysize_max(pagesize: isize, flags: MDBX_db_flags_t) -> isize;
}
extern "C" {
    pub fn mdbx_limits_valsize_max(pagesize: isize, flags: MDBX_db_flags_t) -> isize;
}
extern "C" {
    pub fn mdbx_limits_txnsize_max(pagesize: isize) -> isize;
}
extern "C" {
    pub fn mdbx_default_pagesize() -> usize;
}
extern "C" {
    pub fn mdbx_get_sysraminfo(
        page_size: *mut isize,
        total_pages: *mut isize,
        avail_pages: *mut isize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_maxkeysize_ex(
        env: *const MDBX_env,
        flags: MDBX_db_flags_t,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_maxvalsize_ex(
        env: *const MDBX_env,
        flags: MDBX_db_flags_t,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_maxkeysize(env: *const MDBX_env) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_set_userctx(env: *mut MDBX_env, ctx: *mut ::libc::c_void) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_userctx(env: *const MDBX_env) -> *mut ::libc::c_void;
}
extern "C" {
    pub fn mdbx_txn_begin_ex(
        env: *mut MDBX_env,
        parent: *mut MDBX_txn,
        flags: MDBX_txn_flags_t,
        txn: *mut *mut MDBX_txn,
        context: *mut ::libc::c_void,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_set_userctx(txn: *mut MDBX_txn, ctx: *mut ::libc::c_void) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_get_userctx(txn: *const MDBX_txn) -> *mut ::libc::c_void;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_txn_info {
    pub txn_id: u64,
    pub txn_reader_lag: u64,
    pub txn_space_used: u64,
    pub txn_space_limit_soft: u64,
    pub txn_space_limit_hard: u64,
    pub txn_space_retired: u64,
    pub txn_space_leftover: u64,
    pub txn_space_dirty: u64,
}
extern "C" {
    pub fn mdbx_txn_info(
        txn: *const MDBX_txn,
        info: *mut MDBX_txn_info,
        scan_rlt: bool,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_env(txn: *const MDBX_txn) -> *mut MDBX_env;
}
extern "C" {
    pub fn mdbx_txn_flags(txn: *const MDBX_txn) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_id(txn: *const MDBX_txn) -> u64;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_commit_latency {
    pub preparation: u32,
    pub gc: u32,
    pub audit: u32,
    pub write: u32,
    pub sync: u32,
    pub ending: u32,
    pub whole: u32,
}
extern "C" {
    pub fn mdbx_txn_commit_ex(
        txn: *mut MDBX_txn,
        latency: *mut MDBX_commit_latency,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_abort(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_break(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_reset(txn: *mut MDBX_txn) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_renew(txn: *mut MDBX_txn) -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct MDBX_canary {
    pub x: u64,
    pub y: u64,
    pub z: u64,
    pub v: u64,
}
extern "C" {
    pub fn mdbx_canary_put(txn: *mut MDBX_txn, canary: *const MDBX_canary) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_canary_get(txn: *const MDBX_txn, canary: *mut MDBX_canary) -> ::libc::c_int;
}
pub type MDBX_cmp_func = ::std::option::Option<
    unsafe extern "C" fn(a: *const MDBX_val, b: *const MDBX_val) -> ::libc::c_int,
>;
extern "C" {
    pub fn mdbx_dbi_open(
        txn: *mut MDBX_txn,
        name: *const ::libc::c_char,
        flags: MDBX_db_flags_t,
        dbi: *mut MDBX_dbi,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_dbi_open_ex(
        txn: *mut MDBX_txn,
        name: *const ::libc::c_char,
        flags: MDBX_db_flags_t,
        dbi: *mut MDBX_dbi,
        keycmp: MDBX_cmp_func,
        datacmp: MDBX_cmp_func,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_key_from_jsonInteger(json_integer: i64) -> u64;
}
extern "C" {
    pub fn mdbx_key_from_double(ieee754_64bit: f64) -> u64;
}
extern "C" {
    pub fn mdbx_key_from_ptrdouble(ieee754_64bit: *const f64) -> u64;
}
extern "C" {
    pub fn mdbx_key_from_float(ieee754_32bit: f32) -> u32;
}
extern "C" {
    pub fn mdbx_key_from_ptrfloat(ieee754_32bit: *const f32) -> u32;
}
extern "C" {
    pub fn mdbx_jsonInteger_from_key(arg1: MDBX_val) -> i64;
}
extern "C" {
    pub fn mdbx_double_from_key(arg1: MDBX_val) -> f64;
}
extern "C" {
    pub fn mdbx_float_from_key(arg1: MDBX_val) -> f32;
}
extern "C" {
    pub fn mdbx_int32_from_key(arg1: MDBX_val) -> i32;
}
extern "C" {
    pub fn mdbx_int64_from_key(arg1: MDBX_val) -> i64;
}
extern "C" {
    pub fn mdbx_dbi_stat(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        stat: *mut MDBX_stat,
        bytes: usize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_dbi_dupsort_depthmask(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        mask: *mut u32,
    ) -> ::libc::c_int;
}
impl MDBX_dbi_state_t {
    pub const MDBX_DBI_DIRTY: MDBX_dbi_state_t = MDBX_dbi_state_t(1);
}
impl MDBX_dbi_state_t {
    pub const MDBX_DBI_STALE: MDBX_dbi_state_t = MDBX_dbi_state_t(2);
}
impl MDBX_dbi_state_t {
    pub const MDBX_DBI_FRESH: MDBX_dbi_state_t = MDBX_dbi_state_t(4);
}
impl MDBX_dbi_state_t {
    pub const MDBX_DBI_CREAT: MDBX_dbi_state_t = MDBX_dbi_state_t(8);
}
impl ::std::ops::BitOr<MDBX_dbi_state_t> for MDBX_dbi_state_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_dbi_state_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_dbi_state_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_dbi_state_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_dbi_state_t> for MDBX_dbi_state_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_dbi_state_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_dbi_state_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_dbi_state_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_dbi_state_t(pub ::libc::c_uint);
extern "C" {
    pub fn mdbx_dbi_flags_ex(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        flags: *mut ::libc::c_uint,
        state: *mut ::libc::c_uint,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_dbi_close(env: *mut MDBX_env, dbi: MDBX_dbi) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_drop(txn: *mut MDBX_txn, dbi: MDBX_dbi, del: bool) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_get(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *const MDBX_val,
        data: *mut MDBX_val,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_get_ex(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *mut MDBX_val,
        data: *mut MDBX_val,
        values_count: *mut usize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_get_equal_or_great(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *mut MDBX_val,
        data: *mut MDBX_val,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_put(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *const MDBX_val,
        data: *mut MDBX_val,
        flags: MDBX_put_flags_t,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_replace(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *const MDBX_val,
        new_data: *mut MDBX_val,
        old_data: *mut MDBX_val,
        flags: MDBX_put_flags_t,
    ) -> ::libc::c_int;
}
pub type MDBX_preserve_func = ::std::option::Option<
    unsafe extern "C" fn(
        context: *mut ::libc::c_void,
        target: *mut MDBX_val,
        src: *const ::libc::c_void,
        bytes: usize,
    ) -> ::libc::c_int,
>;
extern "C" {
    pub fn mdbx_replace_ex(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *const MDBX_val,
        new_data: *mut MDBX_val,
        old_data: *mut MDBX_val,
        flags: MDBX_put_flags_t,
        preserver: MDBX_preserve_func,
        preserver_context: *mut ::libc::c_void,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_del(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        key: *const MDBX_val,
        data: *const MDBX_val,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_create(context: *mut ::libc::c_void) -> *mut MDBX_cursor;
}
extern "C" {
    pub fn mdbx_cursor_set_userctx(
        cursor: *mut MDBX_cursor,
        ctx: *mut ::libc::c_void,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_get_userctx(cursor: *const MDBX_cursor) -> *mut ::libc::c_void;
}
extern "C" {
    pub fn mdbx_cursor_bind(
        txn: *mut MDBX_txn,
        cursor: *mut MDBX_cursor,
        dbi: MDBX_dbi,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_open(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        cursor: *mut *mut MDBX_cursor,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_close(cursor: *mut MDBX_cursor);
}
extern "C" {
    pub fn mdbx_cursor_renew(txn: *mut MDBX_txn, cursor: *mut MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_txn(cursor: *const MDBX_cursor) -> *mut MDBX_txn;
}
extern "C" {
    pub fn mdbx_cursor_dbi(cursor: *const MDBX_cursor) -> MDBX_dbi;
}
extern "C" {
    pub fn mdbx_cursor_copy(src: *const MDBX_cursor, dest: *mut MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_get(
        cursor: *mut MDBX_cursor,
        key: *mut MDBX_val,
        data: *mut MDBX_val,
        op: MDBX_cursor_op,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_get_batch(
        cursor: *mut MDBX_cursor,
        count: *mut usize,
        pairs: *mut MDBX_val,
        limit: usize,
        op: MDBX_cursor_op,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_put(
        cursor: *mut MDBX_cursor,
        key: *const MDBX_val,
        data: *mut MDBX_val,
        flags: MDBX_put_flags_t,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_del(cursor: *mut MDBX_cursor, flags: MDBX_put_flags_t) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_count(cursor: *const MDBX_cursor, pcount: *mut usize) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_eof(cursor: *const MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_on_first(cursor: *const MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cursor_on_last(cursor: *const MDBX_cursor) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_estimate_distance(
        first: *const MDBX_cursor,
        last: *const MDBX_cursor,
        distance_items: *mut isize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_estimate_move(
        cursor: *const MDBX_cursor,
        key: *mut MDBX_val,
        data: *mut MDBX_val,
        move_op: MDBX_cursor_op,
        distance_items: *mut isize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_estimate_range(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        begin_key: *mut MDBX_val,
        begin_data: *mut MDBX_val,
        end_key: *mut MDBX_val,
        end_data: *mut MDBX_val,
        distance_items: *mut isize,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_is_dirty(txn: *const MDBX_txn, ptr: *const ::libc::c_void) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_dbi_sequence(
        txn: *mut MDBX_txn,
        dbi: MDBX_dbi,
        result: *mut u64,
        increment: u64,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_cmp(
        txn: *const MDBX_txn,
        dbi: MDBX_dbi,
        a: *const MDBX_val,
        b: *const MDBX_val,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_get_keycmp(flags: MDBX_db_flags_t) -> MDBX_cmp_func;
}
extern "C" {
    pub fn mdbx_dcmp(
        txn: *const MDBX_txn,
        dbi: MDBX_dbi,
        a: *const MDBX_val,
        b: *const MDBX_val,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_get_datacmp(flags: MDBX_db_flags_t) -> MDBX_cmp_func;
}
pub type MDBX_reader_list_func = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut ::libc::c_void,
        num: ::libc::c_int,
        slot: ::libc::c_int,
        pid: mdbx_pid_t,
        thread: mdbx_tid_t,
        txnid: u64,
        lag: u64,
        bytes_used: usize,
        bytes_retained: usize,
    ) -> ::libc::c_int,
>;
extern "C" {
    pub fn mdbx_reader_list(
        env: *const MDBX_env,
        func: MDBX_reader_list_func,
        ctx: *mut ::libc::c_void,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_reader_check(env: *mut MDBX_env, dead: *mut ::libc::c_int) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_txn_straggler(txn: *const MDBX_txn, percent: *mut ::libc::c_int) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_thread_register(env: *const MDBX_env) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_thread_unregister(env: *const MDBX_env) -> ::libc::c_int;
}
pub type MDBX_hsr_func = ::std::option::Option<
    unsafe extern "C" fn(
        env: *const MDBX_env,
        txn: *const MDBX_txn,
        pid: mdbx_pid_t,
        tid: mdbx_tid_t,
        laggard: u64,
        gap: ::libc::c_uint,
        space: usize,
        retry: ::libc::c_int,
    ) -> ::libc::c_int,
>;
extern "C" {
    pub fn mdbx_env_set_hsr(env: *mut MDBX_env, hsr_callback: MDBX_hsr_func) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_get_hsr(env: *const MDBX_env) -> MDBX_hsr_func;
}
impl MDBX_page_type_t {
    pub const MDBX_page_broken: MDBX_page_type_t = MDBX_page_type_t(0);
}
impl MDBX_page_type_t {
    pub const MDBX_page_meta: MDBX_page_type_t = MDBX_page_type_t(1);
}
impl MDBX_page_type_t {
    pub const MDBX_page_large: MDBX_page_type_t = MDBX_page_type_t(2);
}
impl MDBX_page_type_t {
    pub const MDBX_page_branch: MDBX_page_type_t = MDBX_page_type_t(3);
}
impl MDBX_page_type_t {
    pub const MDBX_page_leaf: MDBX_page_type_t = MDBX_page_type_t(4);
}
impl MDBX_page_type_t {
    pub const MDBX_page_dupfixed_leaf: MDBX_page_type_t = MDBX_page_type_t(5);
}
impl MDBX_page_type_t {
    pub const MDBX_subpage_leaf: MDBX_page_type_t = MDBX_page_type_t(6);
}
impl MDBX_page_type_t {
    pub const MDBX_subpage_dupfixed_leaf: MDBX_page_type_t = MDBX_page_type_t(7);
}
impl MDBX_page_type_t {
    pub const MDBX_subpage_broken: MDBX_page_type_t = MDBX_page_type_t(8);
}
impl ::std::ops::BitOr<MDBX_page_type_t> for MDBX_page_type_t {
    type Output = Self;
    #[inline]
    fn bitor(self, other: Self) -> Self {
        MDBX_page_type_t(self.0 | other.0)
    }
}
impl ::std::ops::BitOrAssign for MDBX_page_type_t {
    #[inline]
    fn bitor_assign(&mut self, rhs: MDBX_page_type_t) {
        self.0 |= rhs.0;
    }
}
impl ::std::ops::BitAnd<MDBX_page_type_t> for MDBX_page_type_t {
    type Output = Self;
    #[inline]
    fn bitand(self, other: Self) -> Self {
        MDBX_page_type_t(self.0 & other.0)
    }
}
impl ::std::ops::BitAndAssign for MDBX_page_type_t {
    #[inline]
    fn bitand_assign(&mut self, rhs: MDBX_page_type_t) {
        self.0 &= rhs.0;
    }
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MDBX_page_type_t(pub ::libc::c_uint);
pub type MDBX_pgvisitor_func = ::std::option::Option<
    unsafe extern "C" fn(
        pgno: u64,
        number: ::libc::c_uint,
        ctx: *mut ::libc::c_void,
        deep: ::libc::c_int,
        dbi: *const ::libc::c_char,
        page_size: usize,
        type_: MDBX_page_type_t,
        err: MDBX_error_t,
        nentries: usize,
        payload_bytes: usize,
        header_bytes: usize,
        unused_bytes: usize,
    ) -> ::libc::c_int,
>;
extern "C" {
    pub fn mdbx_env_pgwalk(
        txn: *mut MDBX_txn,
        visitor: MDBX_pgvisitor_func,
        ctx: *mut ::libc::c_void,
        dont_check_keys_ordering: bool,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_open_for_recovery(
        env: *mut MDBX_env,
        pathname: *const ::libc::c_char,
        target_meta: ::libc::c_uint,
        writeable: bool,
    ) -> ::libc::c_int;
}
extern "C" {
    pub fn mdbx_env_turn_for_recovery(
        env: *mut MDBX_env,
        target_meta: ::libc::c_uint,
    ) -> ::libc::c_int;
}
pub type __builtin_va_list = *mut ::libc::c_char;