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
/* automatically generated by rust-bindgen */

pub const _STDINT_H: ::std::os::raw::c_uint = 1;
pub const _FEATURES_H: ::std::os::raw::c_uint = 1;
pub const __USE_ISOC99: ::std::os::raw::c_uint = 1;
pub const __USE_ISOC95: ::std::os::raw::c_uint = 1;
pub const __USE_FORTIFY_LEVEL: ::std::os::raw::c_uint = 0;
pub const _STDC_PREDEF_H: ::std::os::raw::c_uint = 1;
pub const __STDC_IEC_559__: ::std::os::raw::c_uint = 1;
pub const __STDC_IEC_559_COMPLEX__: ::std::os::raw::c_uint = 1;
pub const __STDC_ISO_10646__: ::std::os::raw::c_uint = 201103;
pub const __STDC_NO_THREADS__: ::std::os::raw::c_uint = 1;
pub const __GNU_LIBRARY__: ::std::os::raw::c_uint = 6;
pub const __GLIBC__: ::std::os::raw::c_uint = 2;
pub const __GLIBC_MINOR__: ::std::os::raw::c_uint = 19;
pub const _SYS_CDEFS_H: ::std::os::raw::c_uint = 1;
pub const __WORDSIZE: ::std::os::raw::c_uint = 64;
pub const __WORDSIZE_TIME64_COMPAT32: ::std::os::raw::c_uint = 1;
pub const __SYSCALL_WORDSIZE: ::std::os::raw::c_uint = 64;
pub const _BITS_WCHAR_H: ::std::os::raw::c_uint = 1;
pub const INT8_MIN: ::std::os::raw::c_int = -128;
pub const INT16_MIN: ::std::os::raw::c_int = -32768;
pub const INT32_MIN: ::std::os::raw::c_int = -2147483648;
pub const INT8_MAX: ::std::os::raw::c_uint = 127;
pub const INT16_MAX: ::std::os::raw::c_uint = 32767;
pub const INT32_MAX: ::std::os::raw::c_uint = 2147483647;
pub const UINT8_MAX: ::std::os::raw::c_uint = 255;
pub const UINT16_MAX: ::std::os::raw::c_uint = 65535;
pub const UINT32_MAX: ::std::os::raw::c_uint = 4294967295;
pub const INT_LEAST8_MIN: ::std::os::raw::c_int = -128;
pub const INT_LEAST16_MIN: ::std::os::raw::c_int = -32768;
pub const INT_LEAST32_MIN: ::std::os::raw::c_int = -2147483648;
pub const INT_LEAST8_MAX: ::std::os::raw::c_uint = 127;
pub const INT_LEAST16_MAX: ::std::os::raw::c_uint = 32767;
pub const INT_LEAST32_MAX: ::std::os::raw::c_uint = 2147483647;
pub const UINT_LEAST8_MAX: ::std::os::raw::c_uint = 255;
pub const UINT_LEAST16_MAX: ::std::os::raw::c_uint = 65535;
pub const UINT_LEAST32_MAX: ::std::os::raw::c_uint = 4294967295;
pub const INT_FAST8_MIN: ::std::os::raw::c_int = -128;
pub const INT_FAST16_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const INT_FAST32_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const INT_FAST8_MAX: ::std::os::raw::c_uint = 127;
pub const INT_FAST16_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const INT_FAST32_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const UINT_FAST8_MAX: ::std::os::raw::c_uint = 255;
pub const UINT_FAST16_MAX: ::std::os::raw::c_int = -1;
pub const UINT_FAST32_MAX: ::std::os::raw::c_int = -1;
pub const INTPTR_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const INTPTR_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const UINTPTR_MAX: ::std::os::raw::c_int = -1;
pub const PTRDIFF_MIN: ::std::os::raw::c_longlong = -9223372036854775808;
pub const PTRDIFF_MAX: ::std::os::raw::c_ulonglong = 9223372036854775807;
pub const SIG_ATOMIC_MIN: ::std::os::raw::c_int = -2147483648;
pub const SIG_ATOMIC_MAX: ::std::os::raw::c_uint = 2147483647;
pub const SIZE_MAX: ::std::os::raw::c_int = -1;
pub const WINT_MIN: ::std::os::raw::c_uint = 0;
pub const WINT_MAX: ::std::os::raw::c_uint = 4294967295;
pub const _STDLIB_H: ::std::os::raw::c_uint = 1;
pub const __ldiv_t_defined: ::std::os::raw::c_uint = 1;
pub const RAND_MAX: ::std::os::raw::c_uint = 2147483647;
pub const EXIT_FAILURE: ::std::os::raw::c_uint = 1;
pub const EXIT_SUCCESS: ::std::os::raw::c_uint = 0;
pub const true_: ::std::os::raw::c_uint = 1;
pub const false_: ::std::os::raw::c_uint = 0;
pub const __bool_true_false_are_defined: ::std::os::raw::c_uint = 1;
pub type int_least8_t = ::std::os::raw::c_char;
pub type int_least16_t = ::std::os::raw::c_short;
pub type int_least32_t = ::std::os::raw::c_int;
pub type int_least64_t = ::std::os::raw::c_long;
pub type uint_least8_t = ::std::os::raw::c_uchar;
pub type uint_least16_t = ::std::os::raw::c_ushort;
pub type uint_least32_t = ::std::os::raw::c_uint;
pub type uint_least64_t = ::std::os::raw::c_ulong;
pub type int_fast8_t = ::std::os::raw::c_char;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct div_t {
    pub quot: ::std::os::raw::c_int,
    pub rem: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_div_t() {
    assert_eq!(::std::mem::size_of::<div_t>() , 8usize , concat ! (
               "Size of: " , stringify ! ( div_t ) ));
    assert_eq! (::std::mem::align_of::<div_t>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( div_t ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const div_t ) ) . quot as * const _ as usize }
                , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( div_t ) , "::" ,
                stringify ! ( quot ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const div_t ) ) . rem as * const _ as usize } ,
                4usize , concat ! (
                "Alignment of field: " , stringify ! ( div_t ) , "::" ,
                stringify ! ( rem ) ));
}
impl Clone for div_t {
    fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ldiv_t {
    pub quot: ::std::os::raw::c_long,
    pub rem: ::std::os::raw::c_long,
}
#[test]
fn bindgen_test_layout_ldiv_t() {
    assert_eq!(::std::mem::size_of::<ldiv_t>() , 16usize , concat ! (
               "Size of: " , stringify ! ( ldiv_t ) ));
    assert_eq! (::std::mem::align_of::<ldiv_t>() , 8usize , concat ! (
                "Alignment of " , stringify ! ( ldiv_t ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ldiv_t ) ) . quot as * const _ as usize }
                , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( ldiv_t ) , "::" ,
                stringify ! ( quot ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const ldiv_t ) ) . rem as * const _ as usize }
                , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( ldiv_t ) , "::" ,
                stringify ! ( rem ) ));
}
impl Clone for ldiv_t {
    fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct lldiv_t {
    pub quot: ::std::os::raw::c_longlong,
    pub rem: ::std::os::raw::c_longlong,
}
#[test]
fn bindgen_test_layout_lldiv_t() {
    assert_eq!(::std::mem::size_of::<lldiv_t>() , 16usize , concat ! (
               "Size of: " , stringify ! ( lldiv_t ) ));
    assert_eq! (::std::mem::align_of::<lldiv_t>() , 8usize , concat ! (
                "Alignment of " , stringify ! ( lldiv_t ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const lldiv_t ) ) . quot as * const _ as usize
                } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( lldiv_t ) , "::" ,
                stringify ! ( quot ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const lldiv_t ) ) . rem as * const _ as usize }
                , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( lldiv_t ) , "::" ,
                stringify ! ( rem ) ));
}
impl Clone for lldiv_t {
    fn clone(&self) -> Self { *self }
}
extern "C" {
    pub fn __ctype_get_mb_cur_max() -> usize;
}
extern "C" {
    pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64;
}
extern "C" {
    pub fn atoi(__nptr: *const ::std::os::raw::c_char)
     -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn atol(__nptr: *const ::std::os::raw::c_char)
     -> ::std::os::raw::c_long;
}
extern "C" {
    pub fn atoll(__nptr: *const ::std::os::raw::c_char)
     -> ::std::os::raw::c_longlong;
}
extern "C" {
    pub fn strtod(__nptr: *const ::std::os::raw::c_char,
                  __endptr: *mut *mut ::std::os::raw::c_char) -> f64;
}
extern "C" {
    pub fn strtof(__nptr: *const ::std::os::raw::c_char,
                  __endptr: *mut *mut ::std::os::raw::c_char) -> f32;
}
extern "C" {
    pub fn strtold(__nptr: *const ::std::os::raw::c_char,
                   __endptr: *mut *mut ::std::os::raw::c_char) -> f64;
}
extern "C" {
    pub fn strtol(__nptr: *const ::std::os::raw::c_char,
                  __endptr: *mut *mut ::std::os::raw::c_char,
                  __base: ::std::os::raw::c_int) -> ::std::os::raw::c_long;
}
extern "C" {
    pub fn strtoul(__nptr: *const ::std::os::raw::c_char,
                   __endptr: *mut *mut ::std::os::raw::c_char,
                   __base: ::std::os::raw::c_int) -> ::std::os::raw::c_ulong;
}
extern "C" {
    pub fn strtoll(__nptr: *const ::std::os::raw::c_char,
                   __endptr: *mut *mut ::std::os::raw::c_char,
                   __base: ::std::os::raw::c_int)
     -> ::std::os::raw::c_longlong;
}
extern "C" {
    pub fn strtoull(__nptr: *const ::std::os::raw::c_char,
                    __endptr: *mut *mut ::std::os::raw::c_char,
                    __base: ::std::os::raw::c_int)
     -> ::std::os::raw::c_ulonglong;
}
extern "C" {
    pub fn rand() -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn srand(__seed: ::std::os::raw::c_uint);
}
extern "C" {
    pub fn malloc(__size: usize) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn calloc(__nmemb: usize, __size: usize)
     -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn realloc(__ptr: *mut ::std::os::raw::c_void, __size: usize)
     -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn free(__ptr: *mut ::std::os::raw::c_void);
}
extern "C" {
    pub fn abort();
}
extern "C" {
    pub fn atexit(__func: ::std::option::Option<unsafe extern "C" fn()>)
     -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn exit(__status: ::std::os::raw::c_int);
}
extern "C" {
    pub fn _Exit(__status: ::std::os::raw::c_int);
}
extern "C" {
    pub fn getenv(__name: *const ::std::os::raw::c_char)
     -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn system(__command: *const ::std::os::raw::c_char)
     -> ::std::os::raw::c_int;
}
pub type __compar_fn_t =
    ::std::option::Option<unsafe extern "C" fn(arg1:
                                                   *const ::std::os::raw::c_void,
                                               arg2:
                                                   *const ::std::os::raw::c_void)
                              -> ::std::os::raw::c_int>;
extern "C" {
    pub fn bsearch(__key: *const ::std::os::raw::c_void,
                   __base: *const ::std::os::raw::c_void, __nmemb: usize,
                   __size: usize, __compar: __compar_fn_t)
     -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn qsort(__base: *mut ::std::os::raw::c_void, __nmemb: usize,
                 __size: usize, __compar: __compar_fn_t);
}
extern "C" {
    pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long;
}
extern "C" {
    pub fn llabs(__x: ::std::os::raw::c_longlong)
     -> ::std::os::raw::c_longlong;
}
extern "C" {
    pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int)
     -> div_t;
}
extern "C" {
    pub fn ldiv(__numer: ::std::os::raw::c_long,
                __denom: ::std::os::raw::c_long) -> ldiv_t;
}
extern "C" {
    pub fn lldiv(__numer: ::std::os::raw::c_longlong,
                 __denom: ::std::os::raw::c_longlong) -> lldiv_t;
}
extern "C" {
    pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize)
     -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn mbtowc(__pwc: *mut wchar_t, __s: *const ::std::os::raw::c_char,
                  __n: usize) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t)
     -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char,
                    __n: usize) -> usize;
}
extern "C" {
    pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t,
                    __n: usize) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_context_([u8; 0]);
/// Primary context for invoking Google VR APIs.
pub type gvr_context = gvr_context_;
#[repr(u32)]
/// An enum for the left and right eye.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_eye { GVR_LEFT_EYE = 0, GVR_RIGHT_EYE = 1, GVR_NUM_EYES = 2, }
#[repr(u32)]
/// The type of VR viewer.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_viewer_type {
    GVR_VIEWER_TYPE_CARDBOARD = 0,
    GVR_VIEWER_TYPE_DAYDREAM = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_feature { GVR_FEATURE_ASYNC_REPROJECTION = 0, }
/// Version information for the Google VR API.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_version_ {
    pub major: i32,
    pub minor: i32,
    pub patch: i32,
}
#[test]
fn bindgen_test_layout_gvr_version_() {
    assert_eq!(::std::mem::size_of::<gvr_version_>() , 12usize , concat ! (
               "Size of: " , stringify ! ( gvr_version_ ) ));
    assert_eq! (::std::mem::align_of::<gvr_version_>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_version_ ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_version_ ) ) . major as * const _ as
                usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_version_ ) , "::" ,
                stringify ! ( major ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_version_ ) ) . minor as * const _ as
                usize } , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_version_ ) , "::" ,
                stringify ! ( minor ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_version_ ) ) . patch as * const _ as
                usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_version_ ) , "::" ,
                stringify ! ( patch ) ));
}
impl Clone for gvr_version_ {
    fn clone(&self) -> Self { *self }
}
pub type gvr_version = gvr_version_;
/// An integral 2D size. Used for render target sizes.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_sizei {
    pub width: i32,
    pub height: i32,
}
#[test]
fn bindgen_test_layout_gvr_sizei() {
    assert_eq!(::std::mem::size_of::<gvr_sizei>() , 8usize , concat ! (
               "Size of: " , stringify ! ( gvr_sizei ) ));
    assert_eq! (::std::mem::align_of::<gvr_sizei>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_sizei ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_sizei ) ) . width as * const _ as
                usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_sizei ) , "::" ,
                stringify ! ( width ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_sizei ) ) . height as * const _ as
                usize } , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_sizei ) , "::" ,
                stringify ! ( height ) ));
}
impl Clone for gvr_sizei {
    fn clone(&self) -> Self { *self }
}
/// An integral 2D rect. Used for window bounds in pixels.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_recti {
    pub left: i32,
    pub right: i32,
    pub bottom: i32,
    pub top: i32,
}
#[test]
fn bindgen_test_layout_gvr_recti() {
    assert_eq!(::std::mem::size_of::<gvr_recti>() , 16usize , concat ! (
               "Size of: " , stringify ! ( gvr_recti ) ));
    assert_eq! (::std::mem::align_of::<gvr_recti>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_recti ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_recti ) ) . left as * const _ as
                usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_recti ) , "::" ,
                stringify ! ( left ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_recti ) ) . right as * const _ as
                usize } , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_recti ) , "::" ,
                stringify ! ( right ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_recti ) ) . bottom as * const _ as
                usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_recti ) , "::" ,
                stringify ! ( bottom ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_recti ) ) . top as * const _ as usize
                } , 12usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_recti ) , "::" ,
                stringify ! ( top ) ));
}
impl Clone for gvr_recti {
    fn clone(&self) -> Self { *self }
}
/// A floating point 2D rect. Used for field of view, and also for ranges
/// in texture space. When used for a field of view, all angles are in positive
/// degrees from the optical axis.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_rectf {
    pub left: f32,
    pub right: f32,
    pub bottom: f32,
    pub top: f32,
}
#[test]
fn bindgen_test_layout_gvr_rectf() {
    assert_eq!(::std::mem::size_of::<gvr_rectf>() , 16usize , concat ! (
               "Size of: " , stringify ! ( gvr_rectf ) ));
    assert_eq! (::std::mem::align_of::<gvr_rectf>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_rectf ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_rectf ) ) . left as * const _ as
                usize } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_rectf ) , "::" ,
                stringify ! ( left ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_rectf ) ) . right as * const _ as
                usize } , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_rectf ) , "::" ,
                stringify ! ( right ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_rectf ) ) . bottom as * const _ as
                usize } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_rectf ) , "::" ,
                stringify ! ( bottom ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_rectf ) ) . top as * const _ as usize
                } , 12usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_rectf ) , "::" ,
                stringify ! ( top ) ));
}
impl Clone for gvr_rectf {
    fn clone(&self) -> Self { *self }
}
/// A floating point 2D vector.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_vec2f {
    pub x: f32,
    pub y: f32,
}
#[test]
fn bindgen_test_layout_gvr_vec2f() {
    assert_eq!(::std::mem::size_of::<gvr_vec2f>() , 8usize , concat ! (
               "Size of: " , stringify ! ( gvr_vec2f ) ));
    assert_eq! (::std::mem::align_of::<gvr_vec2f>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_vec2f ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_vec2f ) ) . x as * const _ as usize }
                , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_vec2f ) , "::" ,
                stringify ! ( x ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_vec2f ) ) . y as * const _ as usize }
                , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_vec2f ) , "::" ,
                stringify ! ( y ) ));
}
impl Clone for gvr_vec2f {
    fn clone(&self) -> Self { *self }
}
/// A floating point 3D vector.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_vec3f {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}
#[test]
fn bindgen_test_layout_gvr_vec3f() {
    assert_eq!(::std::mem::size_of::<gvr_vec3f>() , 12usize , concat ! (
               "Size of: " , stringify ! ( gvr_vec3f ) ));
    assert_eq! (::std::mem::align_of::<gvr_vec3f>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_vec3f ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_vec3f ) ) . x as * const _ as usize }
                , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_vec3f ) , "::" ,
                stringify ! ( x ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_vec3f ) ) . y as * const _ as usize }
                , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_vec3f ) , "::" ,
                stringify ! ( y ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_vec3f ) ) . z as * const _ as usize }
                , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_vec3f ) , "::" ,
                stringify ! ( z ) ));
}
impl Clone for gvr_vec3f {
    fn clone(&self) -> Self { *self }
}
/// A floating point 4x4 matrix.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_mat4f {
    pub m: [[f32; 4usize]; 4usize],
}
#[test]
fn bindgen_test_layout_gvr_mat4f() {
    assert_eq!(::std::mem::size_of::<gvr_mat4f>() , 64usize , concat ! (
               "Size of: " , stringify ! ( gvr_mat4f ) ));
    assert_eq! (::std::mem::align_of::<gvr_mat4f>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_mat4f ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_mat4f ) ) . m as * const _ as usize }
                , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_mat4f ) , "::" ,
                stringify ! ( m ) ));
}
impl Clone for gvr_mat4f {
    fn clone(&self) -> Self { *self }
}
/// A floating point quaternion, in JPL format.
/// We use this simple struct in order not to impose a dependency on a
/// particular math library. The user of this API is free to encapsulate this
/// into any math library they want.
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_quatf {
    /// qx, qy, qz are the vector component.
    pub qx: f32,
    pub qy: f32,
    pub qz: f32,
    /// qw is the linelar component.
    pub qw: f32,
}
#[test]
fn bindgen_test_layout_gvr_quatf() {
    assert_eq!(::std::mem::size_of::<gvr_quatf>() , 16usize , concat ! (
               "Size of: " , stringify ! ( gvr_quatf ) ));
    assert_eq! (::std::mem::align_of::<gvr_quatf>() , 4usize , concat ! (
                "Alignment of " , stringify ! ( gvr_quatf ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_quatf ) ) . qx as * const _ as usize
                } , 0usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_quatf ) , "::" ,
                stringify ! ( qx ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_quatf ) ) . qy as * const _ as usize
                } , 4usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_quatf ) , "::" ,
                stringify ! ( qy ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_quatf ) ) . qz as * const _ as usize
                } , 8usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_quatf ) , "::" ,
                stringify ! ( qz ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_quatf ) ) . qw as * const _ as usize
                } , 12usize , concat ! (
                "Alignment of field: " , stringify ! ( gvr_quatf ) , "::" ,
                stringify ! ( qw ) ));
}
impl Clone for gvr_quatf {
    fn clone(&self) -> Self { *self }
}
/// A *monotonic system time* representation. On Android, this is equivalent to
/// System.nanoTime(), or clock_gettime(CLOCK_MONOTONIC). If there is any doubt
/// about how to get the current time for the current platform, simply use
/// gvr_get_time_point_now().
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gvr_clock_time_point {
    pub monotonic_system_time_nanos: i64,
}
#[test]
fn bindgen_test_layout_gvr_clock_time_point() {
    assert_eq!(::std::mem::size_of::<gvr_clock_time_point>() , 8usize , concat
               ! ( "Size of: " , stringify ! ( gvr_clock_time_point ) ));
    assert_eq! (::std::mem::align_of::<gvr_clock_time_point>() , 8usize ,
                concat ! (
                "Alignment of " , stringify ! ( gvr_clock_time_point ) ));
    assert_eq! (unsafe {
                & ( * ( 0 as * const gvr_clock_time_point ) ) .
                monotonic_system_time_nanos as * const _ as usize } , 0usize ,
                concat ! (
                "Alignment of field: " , stringify ! ( gvr_clock_time_point )
                , "::" , stringify ! ( monotonic_system_time_nanos ) ));
}
impl Clone for gvr_clock_time_point {
    fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_buffer_viewport_([u8; 0]);
/// A structure that ties together a region of a buffer, the field of view
/// rendered into that region and a target eye index to define part of the
/// user's field of view. The SDK implementation uses this information to
/// transform the images generated by the app output into the final display that
/// is sent to the screen.
///
/// A set of these structures will most often be generated by the API, via
/// gvr_get_recommended_buffer_viewports() or
/// gvr_get_screen_buffer_viewports(). However, the client may also customize
/// these values via gvr_buffer_viewport_list_set(), constructing a custom
/// gvr_buffer_viewport_list for use in the distortion pass.
pub type gvr_buffer_viewport = gvr_buffer_viewport_;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_buffer_viewport_list_([u8; 0]);
/// List of buffer viewports that completely specifies how to transform the
/// frame's buffers into the image displayed on the screen.
pub type gvr_buffer_viewport_list = gvr_buffer_viewport_list_;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_buffer_spec_([u8; 0]);
/// Specification of a pixel buffer. A pixel buffer can have color, depth and
/// stencil attachments and mostly corresponds to the OpenGL concept of a
/// framebuffer object. However, since there can be multiple such objects for
/// each frame, we avoid calling them "framebuffers". Pixel buffers which are
/// part of the currently acquired frame are immutable, i.e., they cannot be
/// resized or otherwise reconfigured.
pub type gvr_buffer_spec = gvr_buffer_spec_;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_swap_chain_([u8; 0]);
/// Swap chain that contains some number of frames. Frames in the swap chain
/// can be unused, in the process of being distorted and presented on the
/// screen, or acquired and being rendered to by the application. The swap chain
/// ensures that the most recent available frame is always shown and that the
/// application never has to wait to render the next frame.
pub type gvr_swap_chain = gvr_swap_chain_;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_frame_([u8; 0]);
/// A single frame acquired from the swap chain. Each frame is composed of one
/// or more buffers, which are then lens distorted and composited into the final
/// output. Buffers are identified by indices that correspond to the position
/// of their gvr_buffer_spec in the list passed when constructing the swap
/// chain.
pub type gvr_frame = gvr_frame_;
#[repr(u32)]
/// Constants that represent GVR error codes.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_error {
    GVR_ERROR_NONE = 0,
    GVR_ERROR_CONTROLLER_CREATE_FAILED = 2,
    GVR_ERROR_NO_FRAME_AVAILABLE = 3,
}
pub const GVR_CONTROLLER_ENABLE_ORIENTATION: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_ORIENTATION;
pub const GVR_CONTROLLER_ENABLE_TOUCH: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_TOUCH;
pub const GVR_CONTROLLER_ENABLE_GYRO: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_GYRO;
pub const GVR_CONTROLLER_ENABLE_ACCEL: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_ACCEL;
pub const GVR_CONTROLLER_ENABLE_GESTURES: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_GESTURES;
pub const GVR_CONTROLLER_ENABLE_POSE_PREDICTION: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_POSE_PREDICTION;
pub const GVR_CONTROLLER_ENABLE_POSITION: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_POSITION;
pub const GVR_CONTROLLER_ENABLE_BATTERY: _bindgen_ty_1 =
    _bindgen_ty_1::GVR_CONTROLLER_ENABLE_BATTERY;
#[repr(u32)]
/// Controller API options (bit flags).
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_1 {
    GVR_CONTROLLER_ENABLE_ORIENTATION = 1,
    GVR_CONTROLLER_ENABLE_TOUCH = 2,
    GVR_CONTROLLER_ENABLE_GYRO = 4,
    GVR_CONTROLLER_ENABLE_ACCEL = 8,
    GVR_CONTROLLER_ENABLE_GESTURES = 16,
    GVR_CONTROLLER_ENABLE_POSE_PREDICTION = 32,
    GVR_CONTROLLER_ENABLE_POSITION = 64,
    GVR_CONTROLLER_ENABLE_BATTERY = 128,
}
#[repr(u32)]
/// Constants that represent the status of the controller API.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_controller_api_status {
    GVR_CONTROLLER_API_OK = 0,
    GVR_CONTROLLER_API_UNSUPPORTED = 1,
    GVR_CONTROLLER_API_NOT_AUTHORIZED = 2,
    GVR_CONTROLLER_API_UNAVAILABLE = 3,
    GVR_CONTROLLER_API_SERVICE_OBSOLETE = 4,
    GVR_CONTROLLER_API_CLIENT_OBSOLETE = 5,
    GVR_CONTROLLER_API_MALFUNCTION = 6,
}
#[repr(u32)]
/// Constants that represent the state of the controller.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_controller_connection_state {
    GVR_CONTROLLER_DISCONNECTED = 0,
    GVR_CONTROLLER_SCANNING = 1,
    GVR_CONTROLLER_CONNECTING = 2,
    GVR_CONTROLLER_CONNECTED = 3,
}
#[repr(u32)]
/// Controller buttons.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_controller_button {
    GVR_CONTROLLER_BUTTON_NONE = 0,
    GVR_CONTROLLER_BUTTON_CLICK = 1,
    GVR_CONTROLLER_BUTTON_HOME = 2,
    GVR_CONTROLLER_BUTTON_APP = 3,
    GVR_CONTROLLER_BUTTON_VOLUME_UP = 4,
    GVR_CONTROLLER_BUTTON_VOLUME_DOWN = 5,
    GVR_CONTROLLER_BUTTON_COUNT = 6,
}
#[repr(u32)]
/// Controller battery states.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_controller_battery_level {
    GVR_CONTROLLER_BATTERY_LEVEL_UNKNOWN = 0,
    GVR_CONTROLLER_BATTERY_LEVEL_CRITICAL_LOW = 1,
    GVR_CONTROLLER_BATTERY_LEVEL_LOW = 2,
    GVR_CONTROLLER_BATTERY_LEVEL_MEDIUM = 3,
    GVR_CONTROLLER_BATTERY_LEVEL_ALMOST_FULL = 4,
    GVR_CONTROLLER_BATTERY_LEVEL_FULL = 5,
    GVR_CONTROLLER_BATTERY_LEVEL_COUNT = 6,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_controller_state_([u8; 0]);
/// Opaque handle to controller state.
pub type gvr_controller_state = gvr_controller_state_;
#[repr(u32)]
/// Rendering modes define CPU load / rendering quality balances.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_audio_rendering_mode {
    GVR_AUDIO_RENDERING_STEREO_PANNING = 0,
    GVR_AUDIO_RENDERING_BINAURAL_LOW_QUALITY = 1,
    GVR_AUDIO_RENDERING_BINAURAL_HIGH_QUALITY = 2,
}
#[repr(u32)]
/// Room surface material names, used to set room properties.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_audio_material_type {
    GVR_AUDIO_MATERIAL_TRANSPARENT = 0,
    GVR_AUDIO_MATERIAL_ACOUSTIC_CEILING_TILES = 1,
    GVR_AUDIO_MATERIAL_BRICK_BARE = 2,
    GVR_AUDIO_MATERIAL_BRICK_PAINTED = 3,
    GVR_AUDIO_MATERIAL_CONCRETE_BLOCK_COARSE = 4,
    GVR_AUDIO_MATERIAL_CONCRETE_BLOCK_PAINTED = 5,
    GVR_AUDIO_MATERIAL_CURTAIN_HEAVY = 6,
    GVR_AUDIO_MATERIAL_FIBER_GLASS_INSULATION = 7,
    GVR_AUDIO_MATERIAL_GLASS_THIN = 8,
    GVR_AUDIO_MATERIAL_GLASS_THICK = 9,
    GVR_AUDIO_MATERIAL_GRASS = 10,
    GVR_AUDIO_MATERIAL_LINOLEUM_ON_CONCRETE = 11,
    GVR_AUDIO_MATERIAL_MARBLE = 12,
    GVR_AUDIO_MATERIAL_METAL = 13,
    GVR_AUDIO_MATERIAL_PARQUET_ON_CONCRETE = 14,
    GVR_AUDIO_MATERIAL_PLASTER_ROUGH = 15,
    GVR_AUDIO_MATERIAL_PLASTER_SMOOTH = 16,
    GVR_AUDIO_MATERIAL_PLYWOOD_PANEL = 17,
    GVR_AUDIO_MATERIAL_POLISHED_CONCRETE_OR_TILE = 18,
    GVR_AUDIO_MATERIAL_SHEET_ROCK = 19,
    GVR_AUDIO_MATERIAL_WATER_OR_ICE_SURFACE = 20,
    GVR_AUDIO_MATERIAL_WOOD_CEILING = 21,
    GVR_AUDIO_MATERIAL_WOOD_PANEL = 22,
}
#[repr(u32)]
/// Distance rolloff models used for distance attenuation.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_audio_distance_rolloff_type {
    GVR_AUDIO_ROLLOFF_LOGARITHMIC = 0,
    GVR_AUDIO_ROLLOFF_LINEAR = 1,
    GVR_AUDIO_ROLLOFF_NONE = 2,
}
/// Sound object and sound field identifier.
pub type gvr_audio_source_id = i32;
#[repr(u32)]
/// Supported surround sound formats.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_audio_surround_format_type {
    GVR_AUDIO_SURROUND_FORMAT_INVALID = 0,
    GVR_AUDIO_SURROUND_FORMAT_SURROUND_STEREO = 1,
    GVR_AUDIO_SURROUND_FORMAT_SURROUND_FIVE_DOT_ONE = 2,
    GVR_AUDIO_SURROUND_FORMAT_FIRST_ORDER_AMBISONICS = 3,
    GVR_AUDIO_SURROUND_FORMAT_SECOND_ORDER_AMBISONICS = 4,
    GVR_AUDIO_SURROUND_FORMAT_THIRD_ORDER_AMBISONICS = 5,
}
#[repr(u32)]
/// Valid color formats for swap chain buffers.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_color_format_type {
    GVR_COLOR_FORMAT_RGBA_8888 = 0,
    GVR_COLOR_FORMAT_RGB_565 = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_depth_stencil_format_type {
    GVR_DEPTH_STENCIL_FORMAT_NONE = 255,
    GVR_DEPTH_STENCIL_FORMAT_DEPTH_16 = 0,
    GVR_DEPTH_STENCIL_FORMAT_DEPTH_24 = 1,
    GVR_DEPTH_STENCIL_FORMAT_DEPTH_24_STENCIL_8 = 2,
    GVR_DEPTH_STENCIL_FORMAT_DEPTH_32_F = 3,
    GVR_DEPTH_STENCIL_FORMAT_DEPTH_32_F_STENCIL_8 = 4,
    GVR_DEPTH_STENCIL_FORMAT_STENCIL_8 = 5,
}
#[repr(u32)]
/// Types of asynchronous reprojection.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_reprojection {
    GVR_REPROJECTION_NONE = 0,
    GVR_REPROJECTION_FULL = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum gvr_controller_handedness {
    GVR_CONTROLLER_RIGHT_HANDED = 0,
    GVR_CONTROLLER_LEFT_HANDED = 1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gvr_user_prefs_([u8; 0]);
pub type gvr_user_prefs = gvr_user_prefs_;
pub const GVR_EXTERNAL_SURFACE_ID_NONE: _bindgen_ty_2 =
    _bindgen_ty_2::GVR_EXTERNAL_SURFACE_ID_NONE;
pub const GVR_BUFFER_INDEX_EXTERNAL_SURFACE: _bindgen_ty_2 =
    _bindgen_ty_2::GVR_EXTERNAL_SURFACE_ID_NONE;
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum _bindgen_ty_2 { GVR_EXTERNAL_SURFACE_ID_NONE = -1, }
extern "C" {
    /// @return Pointer to the created gvr instance, NULL on failure.
    pub fn gvr_create() -> *mut gvr_context;
}
extern "C" {
    /// Gets the current GVR runtime version.
///
/// Note: This runtime version may differ from the version against which the
/// client app is compiled, as defined by the semantic version components in
/// gvr_version.h.
///
/// @return The version as a gvr_version.
    pub fn gvr_get_version() -> gvr_version;
}
extern "C" {
    /// Gets a string representation of the current GVR runtime version. This is of
/// the form "MAJOR.MINOR.PATCH".
///
/// Note: This runtime version may differ from the version against which the
/// client app is compiled, as defined in gvr_version.h by
/// GVR_SDK_VERSION_STRING.
///
/// @return The version as a static char pointer.
    pub fn gvr_get_version_string() -> *const ::std::os::raw::c_char;
}
extern "C" {
    /// Gets the current GVR error code, or GVR_ERROR_NONE if there is no error.
/// This function doesn't clear the error code; see gvr_clear_error().
///
/// @param gvr Pointer to the gvr instance.
/// @return The current gvr_error code, or GVR_ERROR_NONE if no error has
///    occurred.
    pub fn gvr_get_error(gvr: *mut gvr_context) -> i32;
}
extern "C" {
    /// Clears the current GVR error code, and returns the error code that was
/// cleared.
///
/// @param gvr Pointer to the gvr instance.
/// @return The gvr_error code that was cleared by this function, or
/// GVR_ERROR_NONE if no error has occurred.
    pub fn gvr_clear_error(gvr: *mut gvr_context) -> i32;
}
extern "C" {
    /// Gets a human-readable string representing the given error code.
///
/// @param error_code The gvr_error code.
/// @return A human-readable string representing the error code.
    pub fn gvr_get_error_string(error_code: i32)
     -> *const ::std::os::raw::c_char;
}
extern "C" {
    /// Returns an opaque struct containing information about user preferences.
///
/// The returned struct will remain valid as long as the context is valid.
/// The returned struct may be updated when the user changes their preferences,
/// so this function only needs to be called once, and calling it multiple
/// times will return the same object each time.
///
/// @param gvr Pointer to the gvr instance.
/// @return An opaque struct containing information about user preferences.
    pub fn gvr_get_user_prefs(gvr: *mut gvr_context) -> *const gvr_user_prefs;
}
extern "C" {
    /// Returns the controller handedness of the given gvr_user_prefs struct.
///
/// @param user_prefs Pointer to the gvr_user_prefs object returned by
///     gvr_get_user_prefs.
/// @return Either GVR_CONTROLLER_RIGHT_HANDED or GVR_CONTROLLER_LEFT_HANDED
///     depending on which hand the user holds the controller in.
    pub fn gvr_user_prefs_get_controller_handedness(user_prefs:
                                                        *const gvr_user_prefs)
     -> i32;
}
extern "C" {
    /// Destroys a gvr_context instance.  The parameter will be nulled by this
/// operation.  Once this function is called, the behavior of any subsequent
/// call to a GVR SDK function that references objects created from this
/// context is undefined.
///
/// @param gvr Pointer to a pointer to the gvr instance to be destroyed and
///     nulled.
    pub fn gvr_destroy(gvr: *mut *mut gvr_context);
}
extern "C" {
    /// Initializes necessary GL-related objects and uses the current thread and
/// GL context for rendering. Please make sure that a valid GL context is
/// available when this function is called.  This should never be called more
/// than once on the same GL context (doing so would cause resource leaks).
///
/// @param gvr Pointer to the gvr instance to be initialized.
    pub fn gvr_initialize_gl(gvr: *mut gvr_context);
}
extern "C" {
    /// Gets whether asynchronous reprojection is currently enabled.
///
/// If enabled, frames will be collected by the rendering system and
/// asynchronously re-projected in sync with the scanout of the display. This
/// feature may not be available on every platform, and requires a
/// high-priority render thread with special extensions to function properly.
///
/// Note: On Android, this feature can be enabled solely via the GvrLayout Java
/// instance which (indirectly) owns this gvr_context. The corresponding
/// method call is GvrLayout.setAsyncReprojectionEnabled().
///
/// Note: Because of the above requirements, asynchronous reprojection is only
/// currently available on Daydream-ready Android devices.  This function will
/// always return false on other devices.
///
/// @param gvr Pointer to the gvr instance.
/// @return Whether async reprojection is enabled. Defaults to false.
    pub fn gvr_get_async_reprojection_enabled(gvr: *const gvr_context)
     -> bool;
}
extern "C" {
    /// Gets the recommended buffer viewport configuration, populating a previously
/// allocated gvr_buffer_viewport_list object. The updated values include the
/// per-eye recommended viewport and field of view for the target.
///
/// When the recommended viewports are used for distortion rendering, this
/// method should always be called after calling refresh_viewer_profile(). That
/// will ensure that the populated viewports reflect the currently paired
/// viewer.
///
/// @param gvr Pointer to the gvr instance from which to get the viewports.
/// @param viewport_list Pointer to a previously allocated viewport list. This
///     will be populated with the recommended buffer viewports and resized if
///     necessary.
    pub fn gvr_get_recommended_buffer_viewports(gvr: *const gvr_context,
                                                viewport_list:
                                                    *mut gvr_buffer_viewport_list);
}
extern "C" {
    /// Gets the screen (non-distorted) buffer viewport configuration, populating a
/// previously allocated gvr_buffer_viewport_list object. The updated values
/// include the per-eye recommended viewport and field of view for the target.
///
/// @param gvr Pointer to the gvr instance from which to get the viewports.
/// @param viewport_list Pointer to a previously allocated viewport list. This
///     will be populated with the screen buffer viewports and resized if
///     necessary.
    pub fn gvr_get_screen_buffer_viewports(gvr: *const gvr_context,
                                           viewport_list:
                                               *mut gvr_buffer_viewport_list);
}
extern "C" {
    /// Returns the maximum effective size for the client's render target, given the
/// parameters of the head mounted device selected. At this resolution, we have
/// a 1:1 ratio between source pixels and screen pixels in the most magnified
/// region of the screen. Applications should rarely, if ever, need to render
/// to a larger target, as it will simply result in sampling artifacts.
///
/// Note that this is probably too large for most applications to use as a
/// render target size. Applications should scale this value to be appropriate
/// to their graphical load.
///
/// @param gvr Pointer to the gvr instance from which to get the size.
///
/// @return Maximum effective size for the target render target.
    pub fn gvr_get_maximum_effective_render_target_size(gvr:
                                                            *const gvr_context)
     -> gvr_sizei;
}
extern "C" {
    /// Returns a non-distorted size for the screen, given the parameters
/// of the phone and/or the head mounted device selected.
///
/// @param gvr Pointer to the gvr instance from which to get the size.
///
/// @return Screen (non-distorted) size for the render target.
    pub fn gvr_get_screen_target_size(gvr: *const gvr_context) -> gvr_sizei;
}
extern "C" {
    pub fn gvr_set_surface_size(gvr: *mut gvr_context,
                                surface_size_pixels: gvr_sizei);
}
extern "C" {
    /// @deprecated Use the Swap Chain API instead. This function exists only to
///     support legacy rendering pathways for Cardboard devices. It is
///     incompatible with the low-latency experiences supported by async
///     reprojection.
///
/// Performs postprocessing, including lens distortion, on the contents of the
/// passed texture and shows the result on the screen. Lens distortion is
/// determined by the parameters of the viewer encoded in its QR code. The
/// passed texture is not modified.
///
/// If the application does not call gvr_initialize_gl() before calling this
/// function, the results are undefined.
///
/// @param gvr Pointer to the gvr instance which will do the distortion.
/// @param texture_id The OpenGL ID of the texture that contains the next frame
///     to be displayed.
/// @param viewport_list Rendering parameters.
/// @param head_space_from_start_space This parameter is ignored.
/// @param target_presentation_time This parameter is ignored.
    pub fn gvr_distort_to_screen(gvr: *mut gvr_context, texture_id: i32,
                                 viewport_list:
                                     *const gvr_buffer_viewport_list,
                                 head_space_from_start_space: gvr_mat4f,
                                 target_presentation_time:
                                     gvr_clock_time_point);
}
extern "C" {
    /// Queries whether a particular GVR feature is supported by the underlying
/// platform.
///
/// @param gvr The context to query against.
/// @param feature The gvr_feature type being queried.
/// @return true if feature is supported, false otherwise.
    pub fn gvr_is_feature_supported(gvr: *const gvr_context, feature: i32)
     -> bool;
}
extern "C" {
    /// Creates a gvr_buffer_viewport instance.
    pub fn gvr_buffer_viewport_create(gvr: *mut gvr_context)
     -> *mut gvr_buffer_viewport;
}
extern "C" {
    /// Frees a gvr_buffer_viewport instance and clears the pointer.
    pub fn gvr_buffer_viewport_destroy(viewport:
                                           *mut *mut gvr_buffer_viewport);
}
extern "C" {
    /// Gets the UV coordinates specifying where the output buffer is sampled.
///
/// @param viewport The buffer viewport.
/// @return UV coordinates as a rectangle.
    pub fn gvr_buffer_viewport_get_source_uv(viewport:
                                                 *const gvr_buffer_viewport)
     -> gvr_rectf;
}
extern "C" {
    /// Sets the UV coordinates specifying where the output buffer should be
/// sampled when compositing the final distorted image.
///
/// @param viewport The buffer viewport.
/// @param uv The new UV coordinates for sampling. The coordinates must be
///     valid, that is, left <= right and bottom <= top. Otherwise an empty
///     source region is set, which will result in no output for this viewport.
    pub fn gvr_buffer_viewport_set_source_uv(viewport:
                                                 *mut gvr_buffer_viewport,
                                             uv: gvr_rectf);
}
extern "C" {
    /// Retrieves the field of view for the referenced buffer region.
///
/// This is a helper that converts the stored projection matrix to a field of
/// view. Note that if the previously set projection matrix cannot be expressed
/// as a view frustum aligned with the eye's optical axis, the result will be
/// incorrect.
///
/// @param viewport The buffer viewport.
/// @return The field of view of the rendered image, in degrees.
    pub fn gvr_buffer_viewport_get_source_fov(viewport:
                                                  *const gvr_buffer_viewport)
     -> gvr_rectf;
}
extern "C" {
    /// Sets the field of view for the viewport contents.
///
/// This is a helper that sets the projection matrix in such a way that the
/// viewport's contents fill the specified FOV around the eye's optical axis.
///
/// @param viewport The buffer viewport.
/// @param fov The field of view to use when compositing the rendered image,
///     in degrees.
    pub fn gvr_buffer_viewport_set_source_fov(viewport:
                                                  *mut gvr_buffer_viewport,
                                              fov: gvr_rectf);
}
extern "C" {
    /// Gets the matrix that positions the viewport in eye space.
///
/// @param viewport The buffer viewport.
/// @return Matrix that transforms a quad with vertices (-1, -1, 0), (1, -1, 0),
///     (-1, 1, 0), (1, 1, 0) representing the viewport contents to its desired
///     eye space position for the target eye.
    pub fn gvr_buffer_viewport_get_transform(viewport:
                                                 *const gvr_buffer_viewport)
     -> gvr_mat4f;
}
extern "C" {
    /// Sets the matrix that positions the viewport in eye space.
///
/// @param viewport The buffer viewport.
/// @param transform Matrix that transforms a quad with vertices (-1, -1, 0),
///     (1, -1, 0), (-1, 1, 0), (1, 1, 0) representing the viewport contents to
///     its desired eye space position for the target eye.
    pub fn gvr_buffer_viewport_set_transform(viewport:
                                                 *mut gvr_buffer_viewport,
                                             transform: gvr_mat4f);
}
extern "C" {
    /// Gets the target logical eye for the specified viewport.
///
/// @param viewport The buffer viewport.
/// @return Index of the target logical eye for this viewport.
    pub fn gvr_buffer_viewport_get_target_eye(viewport:
                                                  *const gvr_buffer_viewport)
     -> i32;
}
extern "C" {
    /// Sets the target logical eye for the specified viewport.
///
/// @param viewport The buffer viewport.
/// @param index Index of the target logical eye.
    pub fn gvr_buffer_viewport_set_target_eye(viewport:
                                                  *mut gvr_buffer_viewport,
                                              index: i32);
}
extern "C" {
    /// Gets the index of the source buffer from which the viewport reads its
/// undistorted pixels.
///
/// @param viewport The buffer viewport.
/// @return Index of the source buffer. This corresponds to the index in the
///     list of buffer specs that was passed to gvr_swap_chain_create().
    pub fn gvr_buffer_viewport_get_source_buffer_index(viewport:
                                                           *const gvr_buffer_viewport)
     -> i32;
}
extern "C" {
    /// Sets the buffer from which the viewport reads its undistorted pixels.
///
/// To use the contents of the external surface as buffer contents, associate an
/// external surface with the viewport by calling
/// gvr_buffer_viewport_set_external_surface_id(), then call this function and
/// pass GVR_BUFFER_INDEX_EXTERNAL_SURFACE.
///
/// @param viewport The buffer viewport.
/// @param buffer_index The index of the source buffer. This is either an index
///     in the list of buffer specs that was passed to
///     gvr_swap_chain_create(), or GVR_BUFFER_INDEX_EXTERNAL_SURFACE.
    pub fn gvr_buffer_viewport_set_source_buffer_index(viewport:
                                                           *mut gvr_buffer_viewport,
                                                       buffer_index: i32);
}
extern "C" {
    /// Gets the ID of the externally-managed Surface texture from which this
/// viewport reads undistored pixels.
///
/// @param viewport The buffer viewport.
/// @return ID of the externally-managed Surface of undistorted pixels.
    pub fn gvr_buffer_viewport_get_external_surface_id(viewport:
                                                           *const gvr_buffer_viewport)
     -> i32;
}
extern "C" {
    /// Sets the ID of the externally-managed Surface texture from which this
/// viewport reads. The ID is issued by GvrLayout.
///
/// @param viewport The buffer viewport.
/// @param external_surface_id The ID of the surface to read from.
    pub fn gvr_buffer_viewport_set_external_surface_id(viewport:
                                                           *mut gvr_buffer_viewport,
                                                       external_surface_id:
                                                           i32);
}
extern "C" {
    /// Gets the type of reprojection to perform on the specified viewport.
///
/// @param viewport The buffer viewport.
/// @return Type of reprojection that is applied to the viewport.
    pub fn gvr_buffer_viewport_get_reprojection(viewport:
                                                    *const gvr_buffer_viewport)
     -> i32;
}
extern "C" {
    /// Sets the type of reprojection to perform on the specified viewport.
/// Viewports that display world content should use full reprojection.
/// Viewports that display head-locked UI should disable reprojection to avoid
/// excessive judder. The default is to perform full reprojection.
///
/// @param viewport The buffer viewport.
/// @param reprojection Type of reprojection that will be applied to the passed
///     viewport.
    pub fn gvr_buffer_viewport_set_reprojection(viewport:
                                                    *mut gvr_buffer_viewport,
                                                reprojection: i32);
}
extern "C" {
    /// Compares two gvr_buffer_viewport instances and returns true if they specify
/// the same view mapping.
///
/// @param a Instance of a buffer viewport.
/// @param b Another instance of a buffer viewport.
/// @return True if the passed viewports are the same.
    pub fn gvr_buffer_viewport_equal(a: *const gvr_buffer_viewport,
                                     b: *const gvr_buffer_viewport) -> bool;
}
extern "C" {
    ///     returned object when it is no longer needed.
    pub fn gvr_buffer_viewport_list_create(gvr: *const gvr_context)
     -> *mut gvr_buffer_viewport_list;
}
extern "C" {
    /// Destroys a gvr_buffer_viewport_list instance. The parameter will be nulled
/// by this operation.
///
/// @param viewport_list Pointer to a pointer to the viewport list instance to
///     be destroyed and nulled.
    pub fn gvr_buffer_viewport_list_destroy(viewport_list:
                                                *mut *mut gvr_buffer_viewport_list);
}
extern "C" {
    /// Returns the size of the given viewport list.
///
/// @param viewport_list Pointer to a viewport list.
/// @return The number of entries in the viewport list.
    pub fn gvr_buffer_viewport_list_get_size(viewport_list:
                                                 *const gvr_buffer_viewport_list)
     -> usize;
}
extern "C" {
    /// Retrieve a buffer viewport entry from a list.
///
/// @param viewport_list Pointer to the previously allocated viewport list.
/// @param index Zero-based index of the viewport entry to query. Must be
///    smaller than the list size.
/// @param viewport The buffer viewport structure that will be populated with
///    retrieved data.
    pub fn gvr_buffer_viewport_list_get_item(viewport_list:
                                                 *const gvr_buffer_viewport_list,
                                             index: usize,
                                             viewport:
                                                 *mut gvr_buffer_viewport);
}
extern "C" {
    /// Update an element of the viewport list or append a new one at the end.
///
/// @param viewport_list Pointer to a previously allocated viewport list.
/// @param index Index of the buffer viewport entry to update. If the
///     `viewport_list` size is equal to the index, a new viewport entry will be
///     added. The `viewport_list` size must *not* be less than the index value.
/// @param viewport A pointer to the buffer viewport object.
    pub fn gvr_buffer_viewport_list_set_item(viewport_list:
                                                 *mut gvr_buffer_viewport_list,
                                             index: usize,
                                             viewport:
                                                 *const gvr_buffer_viewport);
}
extern "C" {
    /// Creates a default buffer specification.
    pub fn gvr_buffer_spec_create(gvr: *mut gvr_context)
     -> *mut gvr_buffer_spec;
}
extern "C" {
    /// Destroy the buffer specification and null the pointer.
    pub fn gvr_buffer_spec_destroy(spec: *mut *mut gvr_buffer_spec);
}
extern "C" {
    /// Gets the size of the buffer to be created.
///
/// @param spec Buffer specification.
/// @return Size of the pixel buffer. The default is equal to the recommended
///     render target size at the time when the specification was created.
    pub fn gvr_buffer_spec_get_size(spec: *const gvr_buffer_spec)
     -> gvr_sizei;
}
extern "C" {
    /// Sets the size of the buffer to be created.
///
/// @param spec Buffer specification.
/// @param size The size. Width and height must both be greater than zero.
///     Otherwise, the application is aborted.
    pub fn gvr_buffer_spec_set_size(spec: *mut gvr_buffer_spec,
                                    size: gvr_sizei);
}
extern "C" {
    /// Gets the number of samples per pixel in the buffer to be created.
///
/// @param spec Buffer specification.
/// @return Value >= 1 giving the number of samples. 1 means multisampling is
///     disabled. Negative values and 0 are never returned.
    pub fn gvr_buffer_spec_get_samples(spec: *const gvr_buffer_spec) -> i32;
}
extern "C" {
    /// Sets the number of samples per pixel in the buffer to be created.
///
/// @param spec Buffer specification.
/// @param num_samples The number of samples. Negative values are an error.
///     The values 0 and 1 are treated identically and indicate that
    pub fn gvr_buffer_spec_set_samples(spec: *mut gvr_buffer_spec,
                                       num_samples: i32);
}
extern "C" {
    /// Sets the color format for the buffer to be created. Default format is
/// GVR_COLOR_FORMAT_RGBA_8888.
///
/// @param spec Buffer specification.
/// @param color_format The color format for the buffer. Valid formats are in
///     the gvr_color_format_type enum.
    pub fn gvr_buffer_spec_set_color_format(spec: *mut gvr_buffer_spec,
                                            color_format: i32);
}
extern "C" {
    /// Sets the depth and stencil format for the buffer to be created. Currently,
/// only packed stencil formats are supported. Default format is
/// GVR_DEPTH_STENCIL_FORMAT_DEPTH_16.
///
/// @param spec Buffer specification.
/// @param depth_stencil_format The depth and stencil format for the buffer.
///     Valid formats are in the gvr_depth_stencil_format_type enum.
    pub fn gvr_buffer_spec_set_depth_stencil_format(spec:
                                                        *mut gvr_buffer_spec,
                                                    depth_stencil_format:
                                                        i32);
}
extern "C" {
    /// Creates a swap chain from the given buffer specifications.
/// This is a potentially time-consuming operation. All frames within the
/// swapchain will be allocated. Once rendering is stopped, call
/// gvr_swap_chain_destroy() to free GPU resources. The passed gvr_context must
/// not be destroyed until then.
///
/// Swap chains can have no buffers. This is useful when only displaying
/// external surfaces. When `count` is zero, `buffers` must be null.
///
/// @param gvr GVR instance for which a swap chain will be created.
/// @param buffers Array of pixel buffer specifications. Each frame in the
///     swap chain will be composed of these buffers.
/// @param count Number of buffer specifications in the array.
/// @return Opaque handle to the newly created swap chain.
    pub fn gvr_swap_chain_create(gvr: *mut gvr_context,
                                 buffers: *mut *const gvr_buffer_spec,
                                 count: i32) -> *mut gvr_swap_chain;
}
extern "C" {
    /// Destroys the swap chain and nulls the pointer.
    pub fn gvr_swap_chain_destroy(swap_chain: *mut *mut gvr_swap_chain);
}
extern "C" {
    /// Gets the number of buffers in each frame of the swap chain.
    pub fn gvr_swap_chain_get_buffer_count(swap_chain: *const gvr_swap_chain)
     -> i32;
}
extern "C" {
    /// Retrieves the size of the specified pixel buffer. Note that if the buffer
/// was resized while the current frame was acquired, the return value will be
/// different than the value obtained from the equivalent function for the
/// current frame.
///
/// @param swap_chain The swap chain.
/// @param index Index of the pixel buffer.
/// @return Size of the specified pixel buffer in frames that will be returned
///     from gvr_swap_chain_acquire_frame().
    pub fn gvr_swap_chain_get_buffer_size(swap_chain: *mut gvr_swap_chain,
                                          index: i32) -> gvr_sizei;
}
extern "C" {
    /// Resizes the specified pixel buffer to the given size. The frames are resized
/// when they are unused, so the currently acquired frame will not be resized
/// immediately.
///
/// @param swap_chain The swap chain.
/// @param index Index of the pixel buffer to resize.
/// @param size New size for the specified pixel buffer.
    pub fn gvr_swap_chain_resize_buffer(swap_chain: *mut gvr_swap_chain,
                                        index: i32, size: gvr_sizei);
}
extern "C" {
    /// Acquires a frame from the swap chain for rendering. Buffers that are part of
/// the frame can then be bound with gvr_frame_bind_buffer(). Once the frame
/// is finished and all its constituent buffers are ready, call
/// gvr_frame_submit() to display it while applying lens distortion.
///
/// @param swap_chain The swap chain.
/// @return Handle to the acquired frame. NULL if the swap chain is invalid,
///     or if acquire has already been called on this swap chain.
    pub fn gvr_swap_chain_acquire_frame(swap_chain: *mut gvr_swap_chain)
     -> *mut gvr_frame;
}
extern "C" {
    /// Binds a pixel buffer that is part of the frame to the OpenGL framebuffer.
///
/// @param frame Frame handle acquired from the swap chain.
/// @param index Index of the pixel buffer to bind. This corresponds to the
///     index in the buffer spec list that was passed to
///     gvr_swap_chain_create().
    pub fn gvr_frame_bind_buffer(frame: *mut gvr_frame, index: i32);
}
extern "C" {
    /// Unbinds any buffers bound from this frame and binds the default OpenGL
/// framebuffer.
    pub fn gvr_frame_unbind(frame: *mut gvr_frame);
}
extern "C" {
    /// Returns the dimensions of the pixel buffer with the specified index. Note
/// that a frame that was acquired before resizing a swap chain buffer will not
/// be resized until it is submitted to the swap chain.
///
/// @param frame Frame handle.
/// @param index Index of the pixel buffer to inspect.
/// @return Dimensions of the specified pixel buffer.
    pub fn gvr_frame_get_buffer_size(frame: *const gvr_frame, index: i32)
     -> gvr_sizei;
}
extern "C" {
    /// Gets the name (ID) of the framebuffer object associated with the specified
/// buffer. The OpenGL state is not modified.
///
/// @param frame Frame handle.
/// @param index Index of a pixel buffer.
/// @return OpenGL object name (ID) of a framebuffer object which can be used
///     to render into the buffer. The ID is valid only until the frame is
///     submitted.
    pub fn gvr_frame_get_framebuffer_object(frame: *const gvr_frame,
                                            index: i32) -> i32;
}
extern "C" {
    /// Submits the frame for distortion and display on the screen. The passed
/// pointer is nulled to prevent reuse.
///
/// @param frame The frame to submit.
/// @param list Buffer view configuration to be used for this frame.
/// @param head_space_from_start_space Transform from start space (space with
///     head at the origin at last tracking reset) to head space (space with
///     head at the origin and axes aligned to the view vector).
    pub fn gvr_frame_submit(frame: *mut *mut gvr_frame,
                            list: *const gvr_buffer_viewport_list,
                            head_space_from_start_space: gvr_mat4f);
}
extern "C" {
    /// Resets the OpenGL framebuffer binding to what it was at the time the
/// passed gvr_context was created.
    pub fn gvr_bind_default_framebuffer(gvr: *mut gvr_context);
}
extern "C" {
    /// Gets the current monotonic system time.
///
/// @return The current monotonic system time.
    pub fn gvr_get_time_point_now() -> gvr_clock_time_point;
}
extern "C" {
    /// Gets the rotation from start space to head space.  The head space is a
/// space where the head is at the origin and faces the -Z direction.
///
/// @param gvr Pointer to the gvr instance from which to get the pose.
/// @param time The time at which to get the head pose. The time should be in
///     the future. If the time is not in the future, it will be clamped to now.
/// @return A matrix representation of the rotation from start space (the space
///     where the head was last reset) to head space (the space with the head
///     at the origin, and the axes aligned to the view vector).
    pub fn gvr_get_head_space_from_start_space_rotation(gvr:
                                                            *const gvr_context,
                                                        time:
                                                            gvr_clock_time_point)
     -> gvr_mat4f;
}
extern "C" {
    /// Applies a simple neck model translation based on the rotation of the
/// provided head pose.
///
/// Note: Neck model application may not be appropriate for all tracking
/// scenarios, e.g., when tracking is non-biological.
///
/// @param gvr Pointer to the context instance from which the pose was obtained.
/// @param head_space_from_start_space_rotation The head rotation as returned by
///     gvr_get_head_space_from_start_space_rotation().
/// @param factor A scaling factor for the neck model offset, clamped from 0 to
///     1. This should be 1 for most scenarios, while 0 will effectively disable
///     neck model application. This value can be animated to smoothly
///     interpolate between alternative (client-defined) neck models.
/// @return The new head pose with the neck model applied.
    pub fn gvr_apply_neck_model(gvr: *const gvr_context,
                                head_space_from_start_space_rotation:
                                    gvr_mat4f, factor: f32) -> gvr_mat4f;
}
extern "C" {
    /// Pauses head tracking, disables all sensors (to save power).
///
/// @param gvr Pointer to the gvr instance for which tracking will be paused and
///     sensors disabled.
    pub fn gvr_pause_tracking(gvr: *mut gvr_context);
}
extern "C" {
    /// Resumes head tracking, re-enables all sensors.
///
/// @param gvr Pointer to the gvr instance for which tracking will be resumed.
    pub fn gvr_resume_tracking(gvr: *mut gvr_context);
}
extern "C" {
    /// @deprecated Calls to this method can be safely replaced by calls to
///    gvr_recenter_tracking. This accomplishes the same effects but avoids the
///    undesirable side-effects of a full reset (temporary loss of tracking
///    quality).
///
/// Resets head tracking.
///
/// Only to be used by Cardboard apps. Daydream apps must not call this. On the
/// Daydream platform, recentering is handled automatically and should never
/// be triggered programatically by applications. Hybrid apps that support both
/// Cardboard and Daydream must only call this function when in Cardboard mode
/// (that is, when the phone is paired with a Cardboard viewer), never in
/// Daydream mode.
///
/// @param gvr Pointer to the gvr instance for which tracking will be reseted.
    pub fn gvr_reset_tracking(gvr: *mut gvr_context);
}
extern "C" {
    /// Recenters the head orientation (resets the yaw to zero, leaving pitch and
/// roll unmodified).
///
/// Only to be used by Cardboard apps. Daydream apps must not call this. On the
/// Daydream platform, recentering is handled automatically and should never
/// be triggered programatically by applications. Hybrid apps that support both
/// Cardboard and Daydream must only call this function when in Cardboard mode
/// (that is, when the phone is paired with a Cardboard viewer), never in
/// Daydream mode.
///
/// @param gvr Pointer to the gvr instance for which tracking will be
///     recentered.
    pub fn gvr_recenter_tracking(gvr: *mut gvr_context);
}
extern "C" {
    /// Sets the default viewer profile specified by viewer_profile_uri.
/// The viewer_profile_uri that is passed in will be ignored if a valid
/// viewer profile has already been stored on the device that the app
/// is running on.
///
/// Note: This function has the potential of blocking for up to 30 seconds for
/// each redirect if a shortened URI is passed in as argument. It will try to
/// unroll the shortened URI for a maximum number of 5 times if the redirect
/// continues. In that case, it is recommended to create a separate thread to
/// call this function so that other tasks like rendering will not be blocked
/// on this. The blocking can be avoided if a standard URI is passed in.
///
/// @param gvr Pointer to the gvr instance which to set the profile on.
/// @param viewer_profile_uri A string that contains either the shortened URI or
///     the standard URI representing the viewer profile that the app should be
///     using. If the valid viewer profile can be found on the device, the URI
///     that is passed in will be ignored and nothing will happen. Otherwise,
///     gvr will look for the viewer profile specified by viewer_profile_uri,
///     and it will be stored if found. Also, the values will be applied to gvr.
///     A valid standard URI can be generated from this page:
///     https://www.google.com/get/cardboard/viewerprofilegenerator/
/// @return True if the viewer profile specified by viewer_profile_uri was
///     successfully stored and applied, false otherwise.
    pub fn gvr_set_default_viewer_profile(gvr: *mut gvr_context,
                                          viewer_profile_uri:
                                              *const ::std::os::raw::c_char)
     -> bool;
}
extern "C" {
    /// Refreshes gvr_context with the viewer profile that is stored on the device.
/// If it can not find the viewer profile, nothing will happen.
///
/// @param gvr Pointer to the gvr instance to refresh the profile on.
    pub fn gvr_refresh_viewer_profile(gvr: *mut gvr_context);
}
extern "C" {
    /// Gets the name of the viewer vendor.
///
/// @param gvr Pointer to the gvr instance from which to get the vendor.
/// @return A pointer to the vendor name. May be NULL if no viewer is paired.
///     WARNING: This method guarantees the validity of the returned pointer
///     only until the next use of the `gvr` context. The string should be
///     copied immediately if persistence is required.
    pub fn gvr_get_viewer_vendor(gvr: *const gvr_context)
     -> *const ::std::os::raw::c_char;
}
extern "C" {
    /// Gets the name of the viewer model.
///
/// @param gvr Pointer to the gvr instance from which to get the name.
/// @return A pointer to the model name. May be NULL if no viewer is paired.
///     WARNING: This method guarantees the validity of the returned pointer
///     only until the next use of the `gvr` context. The string should be
///     copied immediately if persistence is required.
    pub fn gvr_get_viewer_model(gvr: *const gvr_context)
     -> *const ::std::os::raw::c_char;
}
extern "C" {
    /// Gets the type of the viewer, as defined by gvr_viewer_type.
///
/// @param gvr Pointer to the gvr instance from which to get the viewer type.
/// @return The gvr_viewer_type of the currently paired viewer.
    pub fn gvr_get_viewer_type(gvr: *const gvr_context) -> i32;
}
extern "C" {
    /// Gets the transformation matrix to convert from Head Space to Eye Space for
/// the given eye.
///
/// @param gvr Pointer to the gvr instance from which to get the matrix.
/// @param eye Selected gvr_eye type.
/// @return Transformation matrix from Head Space to selected Eye Space.
    pub fn gvr_get_eye_from_head_matrix(gvr: *const gvr_context, eye: i32)
     -> gvr_mat4f;
}
extern "C" {
    /// Gets the window bounds.
///
/// @param gvr Pointer to the gvr instance from which to get the bounds.
///
/// @return Window bounds in physical pixels.
    pub fn gvr_get_window_bounds(gvr: *const gvr_context) -> gvr_recti;
}
extern "C" {
    /// Computes the distorted point for a given point in a given eye.  The
/// distortion inverts the optical distortion caused by the lens for the eye.
/// Due to chromatic aberration, the distortion is different for each
/// color channel.
///
/// @param gvr Pointer to the gvr instance which will do the computing.
/// @param eye The gvr_eye type (left or right).
/// @param uv_in A point in screen eye Viewport Space in [0,1]^2 with (0, 0)
///     in the lower left corner of the eye's viewport and (1, 1) in the
///     upper right corner of the eye's viewport.
/// @param uv_out A pointer to an array of (at least) 3 elements, with each
///     element being a Point2f representing a point in render texture eye
///     Viewport Space in [0,1]^2 with (0, 0) in the lower left corner of the
///     eye's viewport and (1, 1) in the upper right corner of the eye's
///     viewport.
///     `uv_out[0]` is the corrected position of `uv_in` for the red channel
///     `uv_out[1]` is the corrected position of `uv_in` for the green channel
///     `uv_out[2]` is the corrected position of `uv_in` for the blue channel
    pub fn gvr_compute_distorted_point(gvr: *const gvr_context, eye: i32,
                                       uv_in: gvr_vec2f,
                                       uv_out: *mut gvr_vec2f);
}