1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
/* automatically generated by rust-bindgen 0.63.0 */

pub const TSK_MAX_ID: u32 = 2147483646;
pub const TSK_VERSION_MAJOR: u32 = 1;
pub const TSK_VERSION_MINOR: u32 = 1;
pub const TSK_VERSION_PATCH: u32 = 1;
pub const TSK_UNKNOWN_TIME_HEX: u64 = 9221248276113224737;
pub const TSK_NODE_IS_SAMPLE: u32 = 1;
pub const TSK_MISSING_DATA: i32 = -1;
pub const TSK_TIME_UNITS_UNKNOWN: &[u8; 8usize] = b"unknown\0";
pub const TSK_TIME_UNITS_UNCALIBRATED: &[u8; 13usize] = b"uncalibrated\0";
pub const TSK_FILE_FORMAT_NAME: &[u8; 12usize] = b"tskit.trees\0";
pub const TSK_FILE_FORMAT_NAME_LENGTH: u32 = 11;
pub const TSK_FILE_FORMAT_VERSION_MAJOR: u32 = 12;
pub const TSK_FILE_FORMAT_VERSION_MINOR: u32 = 7;
pub const TSK_DEBUG: u32 = 2147483648;
pub const TSK_NO_INIT: u32 = 1073741824;
pub const TSK_NO_CHECK_INTEGRITY: u32 = 536870912;
pub const TSK_TAKE_OWNERSHIP: u32 = 268435456;
pub const TSK_ERR_GENERIC: i32 = -1;
pub const TSK_ERR_NO_MEMORY: i32 = -2;
pub const TSK_ERR_IO: i32 = -3;
pub const TSK_ERR_BAD_PARAM_VALUE: i32 = -4;
pub const TSK_ERR_BUFFER_OVERFLOW: i32 = -5;
pub const TSK_ERR_UNSUPPORTED_OPERATION: i32 = -6;
pub const TSK_ERR_GENERATE_UUID: i32 = -7;
pub const TSK_ERR_EOF: i32 = -8;
pub const TSK_ERR_FILE_FORMAT: i32 = -100;
pub const TSK_ERR_FILE_VERSION_TOO_OLD: i32 = -101;
pub const TSK_ERR_FILE_VERSION_TOO_NEW: i32 = -102;
pub const TSK_ERR_REQUIRED_COL_NOT_FOUND: i32 = -103;
pub const TSK_ERR_BOTH_COLUMNS_REQUIRED: i32 = -104;
pub const TSK_ERR_BAD_COLUMN_TYPE: i32 = -105;
pub const TSK_ERR_BAD_OFFSET: i32 = -200;
pub const TSK_ERR_SEEK_OUT_OF_BOUNDS: i32 = -201;
pub const TSK_ERR_NODE_OUT_OF_BOUNDS: i32 = -202;
pub const TSK_ERR_EDGE_OUT_OF_BOUNDS: i32 = -203;
pub const TSK_ERR_POPULATION_OUT_OF_BOUNDS: i32 = -204;
pub const TSK_ERR_SITE_OUT_OF_BOUNDS: i32 = -205;
pub const TSK_ERR_MUTATION_OUT_OF_BOUNDS: i32 = -206;
pub const TSK_ERR_INDIVIDUAL_OUT_OF_BOUNDS: i32 = -207;
pub const TSK_ERR_MIGRATION_OUT_OF_BOUNDS: i32 = -208;
pub const TSK_ERR_PROVENANCE_OUT_OF_BOUNDS: i32 = -209;
pub const TSK_ERR_TIME_NONFINITE: i32 = -210;
pub const TSK_ERR_GENOME_COORDS_NONFINITE: i32 = -211;
pub const TSK_ERR_NULL_PARENT: i32 = -300;
pub const TSK_ERR_NULL_CHILD: i32 = -301;
pub const TSK_ERR_EDGES_NOT_SORTED_PARENT_TIME: i32 = -302;
pub const TSK_ERR_EDGES_NONCONTIGUOUS_PARENTS: i32 = -303;
pub const TSK_ERR_EDGES_NOT_SORTED_CHILD: i32 = -304;
pub const TSK_ERR_EDGES_NOT_SORTED_LEFT: i32 = -305;
pub const TSK_ERR_BAD_NODE_TIME_ORDERING: i32 = -306;
pub const TSK_ERR_BAD_EDGE_INTERVAL: i32 = -307;
pub const TSK_ERR_DUPLICATE_EDGES: i32 = -308;
pub const TSK_ERR_RIGHT_GREATER_SEQ_LENGTH: i32 = -309;
pub const TSK_ERR_LEFT_LESS_ZERO: i32 = -310;
pub const TSK_ERR_BAD_EDGES_CONTRADICTORY_CHILDREN: i32 = -311;
pub const TSK_ERR_CANT_PROCESS_EDGES_WITH_METADATA: i32 = -312;
pub const TSK_ERR_UNSORTED_SITES: i32 = -400;
pub const TSK_ERR_DUPLICATE_SITE_POSITION: i32 = -401;
pub const TSK_ERR_BAD_SITE_POSITION: i32 = -402;
pub const TSK_ERR_MUTATION_PARENT_DIFFERENT_SITE: i32 = -500;
pub const TSK_ERR_MUTATION_PARENT_EQUAL: i32 = -501;
pub const TSK_ERR_MUTATION_PARENT_AFTER_CHILD: i32 = -502;
pub const TSK_ERR_MUTATION_PARENT_INCONSISTENT: i32 = -503;
pub const TSK_ERR_UNSORTED_MUTATIONS: i32 = -504;
pub const TSK_ERR_MUTATION_TIME_YOUNGER_THAN_NODE: i32 = -506;
pub const TSK_ERR_MUTATION_TIME_OLDER_THAN_PARENT_MUTATION: i32 = -507;
pub const TSK_ERR_MUTATION_TIME_OLDER_THAN_PARENT_NODE: i32 = -508;
pub const TSK_ERR_MUTATION_TIME_HAS_BOTH_KNOWN_AND_UNKNOWN: i32 = -509;
pub const TSK_ERR_UNSORTED_MIGRATIONS: i32 = -550;
pub const TSK_ERR_DUPLICATE_SAMPLE: i32 = -600;
pub const TSK_ERR_BAD_SAMPLES: i32 = -601;
pub const TSK_ERR_BAD_TABLE_POSITION: i32 = -700;
pub const TSK_ERR_BAD_SEQUENCE_LENGTH: i32 = -701;
pub const TSK_ERR_TABLES_NOT_INDEXED: i32 = -702;
pub const TSK_ERR_TABLE_OVERFLOW: i32 = -703;
pub const TSK_ERR_COLUMN_OVERFLOW: i32 = -704;
pub const TSK_ERR_TREE_OVERFLOW: i32 = -705;
pub const TSK_ERR_METADATA_DISABLED: i32 = -706;
pub const TSK_ERR_TABLES_BAD_INDEXES: i32 = -707;
pub const TSK_ERR_ONLY_INFINITE_SITES: i32 = -800;
pub const TSK_ERR_SIMPLIFY_MIGRATIONS_NOT_SUPPORTED: i32 = -801;
pub const TSK_ERR_SORT_MIGRATIONS_NOT_SUPPORTED: i32 = -802;
pub const TSK_ERR_SORT_OFFSET_NOT_SUPPORTED: i32 = -803;
pub const TSK_ERR_NONBINARY_MUTATIONS_UNSUPPORTED: i32 = -804;
pub const TSK_ERR_MIGRATIONS_NOT_SUPPORTED: i32 = -805;
pub const TSK_ERR_CANNOT_EXTEND_FROM_SELF: i32 = -806;
pub const TSK_ERR_SILENT_MUTATIONS_NOT_SUPPORTED: i32 = -807;
pub const TSK_ERR_VARIANT_CANT_DECODE_COPY: i32 = -808;
pub const TSK_ERR_CANT_TAKE_OWNERSHIP_NO_EDGE_METADATA: i32 = -809;
pub const TSK_ERR_UNDEFINED_NONBINARY: i32 = -810;
pub const TSK_ERR_UNDEFINED_MULTIROOT: i32 = -811;
pub const TSK_ERR_BAD_NUM_WINDOWS: i32 = -900;
pub const TSK_ERR_BAD_WINDOWS: i32 = -901;
pub const TSK_ERR_MULTIPLE_STAT_MODES: i32 = -902;
pub const TSK_ERR_BAD_STATE_DIMS: i32 = -903;
pub const TSK_ERR_BAD_RESULT_DIMS: i32 = -904;
pub const TSK_ERR_INSUFFICIENT_SAMPLE_SETS: i32 = -905;
pub const TSK_ERR_INSUFFICIENT_INDEX_TUPLES: i32 = -906;
pub const TSK_ERR_BAD_SAMPLE_SET_INDEX: i32 = -907;
pub const TSK_ERR_EMPTY_SAMPLE_SET: i32 = -908;
pub const TSK_ERR_UNSUPPORTED_STAT_MODE: i32 = -909;
pub const TSK_ERR_TIME_UNCALIBRATED: i32 = -910;
pub const TSK_ERR_GENOTYPES_ALL_MISSING: i32 = -1000;
pub const TSK_ERR_BAD_GENOTYPE: i32 = -1001;
pub const TSK_ERR_BAD_ANCESTRAL_STATE: i32 = -1002;
pub const TSK_ERR_MUST_IMPUTE_NON_SAMPLES: i32 = -1100;
pub const TSK_ERR_ALLELE_NOT_FOUND: i32 = -1101;
pub const TSK_ERR_TOO_MANY_ALLELES: i32 = -1102;
pub const TSK_ERR_ZERO_ALLELES: i32 = -1103;
pub const TSK_ERR_SAMPLE_SIZE_MISMATCH: i32 = -1200;
pub const TSK_ERR_SAMPLES_NOT_EQUAL: i32 = -1201;
pub const TSK_ERR_MULTIPLE_ROOTS: i32 = -1202;
pub const TSK_ERR_UNARY_NODES: i32 = -1203;
pub const TSK_ERR_SEQUENCE_LENGTH_MISMATCH: i32 = -1204;
pub const TSK_ERR_NO_SAMPLE_LISTS: i32 = -1205;
pub const TSK_ERR_NULL_VITERBI_MATRIX: i32 = -1300;
pub const TSK_ERR_MATCH_IMPOSSIBLE: i32 = -1301;
pub const TSK_ERR_BAD_COMPRESSED_MATRIX_NODE: i32 = -1302;
pub const TSK_ERR_TOO_MANY_VALUES: i32 = -1303;
pub const TSK_ERR_UNION_BAD_MAP: i32 = -1400;
pub const TSK_ERR_UNION_DIFF_HISTORIES: i32 = -1401;
pub const TSK_ERR_SAME_NODES_IN_PAIR: i32 = -1500;
pub const TSK_ERR_IBD_PAIRS_NOT_STORED: i32 = -1501;
pub const TSK_ERR_IBD_SEGMENTS_NOT_STORED: i32 = -1502;
pub const TSK_ERR_KEEP_UNARY_MUTUALLY_EXCLUSIVE: i32 = -1600;
pub const TSK_ERR_UNSORTED_INDIVIDUALS: i32 = -1700;
pub const TSK_ERR_INDIVIDUAL_SELF_PARENT: i32 = -1701;
pub const TSK_ERR_INDIVIDUAL_PARENT_CYCLE: i32 = -1702;
pub const TSK_ERR_INDIVIDUAL_POPULATION_MISMATCH: i32 = -1703;
pub const TSK_ERR_INDIVIDUAL_TIME_MISMATCH: i32 = -1704;
pub const TSK_KAS_ERR_BIT: u32 = 14;
pub const TSK_BUG_ASSERT_MESSAGE : & [u8 ; 265usize] = b"If you are using tskit directly please open an issue on GitHub, ideally with a reproducible example. (https://github.com/tskit-dev/tskit/issues) If you are using software that uses tskit, please report an issue to that software's issue tracker, at least initially.\0" ;
pub const TSK_UUID_SIZE: u32 = 36;
pub const KAS_ERR_GENERIC: i32 = -1;
pub const KAS_ERR_IO: i32 = -2;
pub const KAS_ERR_BAD_MODE: i32 = -3;
pub const KAS_ERR_NO_MEMORY: i32 = -4;
pub const KAS_ERR_BAD_FILE_FORMAT: i32 = -5;
pub const KAS_ERR_VERSION_TOO_OLD: i32 = -6;
pub const KAS_ERR_VERSION_TOO_NEW: i32 = -7;
pub const KAS_ERR_BAD_TYPE: i32 = -8;
pub const KAS_ERR_EMPTY_KEY: i32 = -9;
pub const KAS_ERR_DUPLICATE_KEY: i32 = -10;
pub const KAS_ERR_KEY_NOT_FOUND: i32 = -11;
pub const KAS_ERR_ILLEGAL_OPERATION: i32 = -12;
pub const KAS_ERR_TYPE_MISMATCH: i32 = -13;
pub const KAS_ERR_EOF: i32 = -14;
pub const KAS_ERR_BAD_FLAGS: i32 = -15;
pub const KAS_READ_ALL: u32 = 1;
pub const KAS_GET_TAKES_OWNERSHIP: u32 = 2;
pub const KAS_BORROWS_ARRAY: u32 = 256;
pub const KAS_INT8: u32 = 0;
pub const KAS_UINT8: u32 = 1;
pub const KAS_INT16: u32 = 2;
pub const KAS_UINT16: u32 = 3;
pub const KAS_INT32: u32 = 4;
pub const KAS_UINT32: u32 = 5;
pub const KAS_INT64: u32 = 6;
pub const KAS_UINT64: u32 = 7;
pub const KAS_FLOAT32: u32 = 8;
pub const KAS_FLOAT64: u32 = 9;
pub const KAS_NUM_TYPES: u32 = 10;
pub const KAS_READ: u32 = 1;
pub const KAS_WRITE: u32 = 2;
pub const KAS_FILE_VERSION_MAJOR: u32 = 1;
pub const KAS_FILE_VERSION_MINOR: u32 = 0;
pub const KAS_VERSION_MAJOR: u32 = 2;
pub const KAS_VERSION_MINOR: u32 = 1;
pub const KAS_VERSION_PATCH: u32 = 1;
pub const KAS_HEADER_SIZE: u32 = 64;
pub const KAS_ITEM_DESCRIPTOR_SIZE: u32 = 64;
pub const KAS_MAGIC: [u8; 9usize] = [137u8, 75u8, 65u8, 83u8, 13u8, 10u8, 26u8, 10u8, 0u8];
pub const KAS_ARRAY_ALIGN: u32 = 8;
pub const KAS_BUG_ASSERT_MESSAGE : & [u8 ; 271usize] = b"If you are using kastore directly please open an issue on GitHub, ideally with a reproducible example. (https://github.com/tskit-dev/kastore/issues) If you are using software that uses kastore, please report an issue to that software's issue tracker, at least initially.\0" ;
pub const TSK_SIMPLIFY_FILTER_SITES: u32 = 1;
pub const TSK_SIMPLIFY_FILTER_POPULATIONS: u32 = 2;
pub const TSK_SIMPLIFY_FILTER_INDIVIDUALS: u32 = 4;
pub const TSK_SIMPLIFY_REDUCE_TO_SITE_TOPOLOGY: u32 = 8;
pub const TSK_SIMPLIFY_KEEP_UNARY: u32 = 16;
pub const TSK_SIMPLIFY_KEEP_INPUT_ROOTS: u32 = 32;
pub const TSK_SIMPLIFY_KEEP_UNARY_IN_INDIVIDUALS: u32 = 64;
pub const TSK_SUBSET_NO_CHANGE_POPULATIONS: u32 = 1;
pub const TSK_SUBSET_KEEP_UNREFERENCED: u32 = 2;
pub const TSK_CHECK_EDGE_ORDERING: u32 = 1;
pub const TSK_CHECK_SITE_ORDERING: u32 = 2;
pub const TSK_CHECK_SITE_DUPLICATES: u32 = 4;
pub const TSK_CHECK_MUTATION_ORDERING: u32 = 8;
pub const TSK_CHECK_INDIVIDUAL_ORDERING: u32 = 16;
pub const TSK_CHECK_MIGRATION_ORDERING: u32 = 32;
pub const TSK_CHECK_INDEXES: u32 = 64;
pub const TSK_CHECK_TREES: u32 = 128;
pub const TSK_NO_CHECK_POPULATION_REFS: u32 = 4096;
pub const TSK_LOAD_SKIP_TABLES: u32 = 1;
pub const TSK_LOAD_SKIP_REFERENCE_SEQUENCE: u32 = 2;
pub const TSK_TABLE_NO_METADATA: u32 = 4;
pub const TSK_TC_NO_EDGE_METADATA: u32 = 8;
pub const TSK_DUMP_FORCE_OFFSET_64: u32 = 134217728;
pub const TSK_COPY_FILE_UUID: u32 = 1;
pub const TSK_UNION_NO_CHECK_SHARED: u32 = 1;
pub const TSK_UNION_NO_ADD_POP: u32 = 2;
pub const TSK_CMP_IGNORE_TS_METADATA: u32 = 1;
pub const TSK_CMP_IGNORE_PROVENANCE: u32 = 2;
pub const TSK_CMP_IGNORE_METADATA: u32 = 4;
pub const TSK_CMP_IGNORE_TIMESTAMPS: u32 = 8;
pub const TSK_CMP_IGNORE_TABLES: u32 = 16;
pub const TSK_CMP_IGNORE_REFERENCE_SEQUENCE: u32 = 32;
pub const TSK_CLEAR_METADATA_SCHEMAS: u32 = 1;
pub const TSK_CLEAR_TS_METADATA_AND_SCHEMA: u32 = 2;
pub const TSK_CLEAR_PROVENANCE: u32 = 4;
pub const TSK_IBD_STORE_PAIRS: u32 = 1;
pub const TSK_IBD_STORE_SEGMENTS: u32 = 2;
pub const TSK_SAMPLE_LISTS: u32 = 2;
pub const TSK_NO_SAMPLE_COUNTS: u32 = 4;
pub const TSK_STAT_SITE: u32 = 1;
pub const TSK_STAT_BRANCH: u32 = 2;
pub const TSK_STAT_NODE: u32 = 4;
pub const TSK_STAT_POLARISED: u32 = 1024;
pub const TSK_STAT_SPAN_NORMALISE: u32 = 2048;
pub const TSK_STAT_ALLOW_TIME_UNCALIBRATED: u32 = 4096;
pub const TSK_MM_FIXED_ANCESTRAL_STATE: u32 = 1;
pub const TSK_DIR_FORWARD: u32 = 1;
pub const TSK_DIR_REVERSE: i32 = -1;
pub const TSK_INCLUDE_TERMINAL: u32 = 1;
pub const TSK_TS_INIT_BUILD_INDEXES: u32 = 1;
pub const TSK_TREE_OK: u32 = 1;
pub const TSK_ISOLATED_NOT_MISSING: u32 = 2;
pub const TSK_NEWICK_LEGACY_MS_LABELS: u32 = 1;
pub const TSK_ALLELES_ACGT: u32 = 65536;
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type FILE = _IO_FILE;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_marker {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_codecvt {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_wide_data {
    _unused: [u8; 0],
}
pub type _IO_lock_t = ::std::os::raw::c_void;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_FILE {
    pub _flags: ::std::os::raw::c_int,
    pub _IO_read_ptr: *mut ::std::os::raw::c_char,
    pub _IO_read_end: *mut ::std::os::raw::c_char,
    pub _IO_read_base: *mut ::std::os::raw::c_char,
    pub _IO_write_base: *mut ::std::os::raw::c_char,
    pub _IO_write_ptr: *mut ::std::os::raw::c_char,
    pub _IO_write_end: *mut ::std::os::raw::c_char,
    pub _IO_buf_base: *mut ::std::os::raw::c_char,
    pub _IO_buf_end: *mut ::std::os::raw::c_char,
    pub _IO_save_base: *mut ::std::os::raw::c_char,
    pub _IO_backup_base: *mut ::std::os::raw::c_char,
    pub _IO_save_end: *mut ::std::os::raw::c_char,
    pub _markers: *mut _IO_marker,
    pub _chain: *mut _IO_FILE,
    pub _fileno: ::std::os::raw::c_int,
    pub _flags2: ::std::os::raw::c_int,
    pub _old_offset: __off_t,
    pub _cur_column: ::std::os::raw::c_ushort,
    pub _vtable_offset: ::std::os::raw::c_schar,
    pub _shortbuf: [::std::os::raw::c_char; 1usize],
    pub _lock: *mut _IO_lock_t,
    pub _offset: __off64_t,
    pub _codecvt: *mut _IO_codecvt,
    pub _wide_data: *mut _IO_wide_data,
    pub _freeres_list: *mut _IO_FILE,
    pub _freeres_buf: *mut ::std::os::raw::c_void,
    pub __pad5: usize,
    pub _mode: ::std::os::raw::c_int,
    pub _unused2: [::std::os::raw::c_char; 20usize],
}
#[test]
fn bindgen_test_layout__IO_FILE() {
    const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_IO_FILE>(),
        216usize,
        concat!("Size of: ", stringify!(_IO_FILE))
    );
    assert_eq!(
        ::std::mem::align_of::<_IO_FILE>(),
        8usize,
        concat!("Alignment of ", stringify!(_IO_FILE))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_flags)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_read_ptr)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_read_end)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_read_base)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_write_base)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_write_ptr)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_write_end)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_buf_base)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_buf_end)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_save_base)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_backup_base)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_IO_save_end)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_markers)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_chain)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_fileno)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize },
        116usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_flags2)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_old_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_cur_column)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize },
        130usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_vtable_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize },
        131usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_shortbuf)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_lock)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize },
        144usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize },
        152usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_codecvt)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize },
        160usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_wide_data)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize },
        168usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_freeres_list)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize },
        176usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_freeres_buf)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize },
        184usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(__pad5)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize },
        192usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_mode)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize },
        196usize,
        concat!(
            "Offset of field: ",
            stringify!(_IO_FILE),
            "::",
            stringify!(_unused2)
        )
    );
}
pub type tsk_id_t = i32;
#[doc = "@brief Tskit sizes.\n\n@rst\nThe ``tsk_size_t`` type is an unsigned integer used for any size or count value.\n@endrst"]
pub type tsk_size_t = u64;
#[doc = "@brief Container for bitwise flags.\n\n@rst\nBitwise flags are used in tskit as a column type and also as a way to\nspecify options to API functions.\n@endrst"]
pub type tsk_flags_t = u32;
extern "C" {
    pub fn tsk_set_kas_error(err: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_is_kas_error(err: ::std::os::raw::c_int) -> bool;
}
extern "C" {
    pub fn tsk_get_kas_error(err: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Return a description of the specified error.\n\nThe memory for the returned string is handled by the library and should\nnot be freed by client code.\n\n@param err A tskit error code.\n@return A description of the error."]
    pub fn tsk_strerror(err: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_blkalloc_t {
    pub chunk_size: usize,
    pub top: usize,
    pub current_chunk: usize,
    pub total_size: usize,
    pub total_allocated: usize,
    pub num_chunks: usize,
    pub mem_chunks: *mut *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_blkalloc_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_blkalloc_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_blkalloc_t>(),
        56usize,
        concat!("Size of: ", stringify!(tsk_blkalloc_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_blkalloc_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_blkalloc_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).chunk_size) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(chunk_size)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).top) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(top)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).current_chunk) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(current_chunk)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).total_size) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(total_size)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).total_allocated) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(total_allocated)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_chunks) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(num_chunks)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mem_chunks) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_blkalloc_t),
            "::",
            stringify!(mem_chunks)
        )
    );
}
extern "C" {
    pub fn tsk_blkalloc_print_state(self_: *mut tsk_blkalloc_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_blkalloc_reset(self_: *mut tsk_blkalloc_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_blkalloc_init(
        self_: *mut tsk_blkalloc_t,
        chunk_size: usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_blkalloc_get(self_: *mut tsk_blkalloc_t, size: usize)
        -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_blkalloc_free(self_: *mut tsk_blkalloc_t);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_avl_node_int_t {
    pub key: i64,
    pub value: *mut ::std::os::raw::c_void,
    pub llink: *mut _tsk_avl_node_int_t,
    pub rlink: *mut _tsk_avl_node_int_t,
    pub balance: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout__tsk_avl_node_int_t() {
    const UNINIT: ::std::mem::MaybeUninit<_tsk_avl_node_int_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_tsk_avl_node_int_t>(),
        40usize,
        concat!("Size of: ", stringify!(_tsk_avl_node_int_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_tsk_avl_node_int_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_tsk_avl_node_int_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_avl_node_int_t),
            "::",
            stringify!(key)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_avl_node_int_t),
            "::",
            stringify!(value)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).llink) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_avl_node_int_t),
            "::",
            stringify!(llink)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).rlink) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_avl_node_int_t),
            "::",
            stringify!(rlink)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).balance) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_avl_node_int_t),
            "::",
            stringify!(balance)
        )
    );
}
pub type tsk_avl_node_int_t = _tsk_avl_node_int_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_avl_tree_int_t {
    pub head: tsk_avl_node_int_t,
    pub size: tsk_size_t,
    pub height: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_avl_tree_int_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_avl_tree_int_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_avl_tree_int_t>(),
        56usize,
        concat!("Size of: ", stringify!(tsk_avl_tree_int_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_avl_tree_int_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_avl_tree_int_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_avl_tree_int_t),
            "::",
            stringify!(head)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_avl_tree_int_t),
            "::",
            stringify!(size)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).height) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_avl_tree_int_t),
            "::",
            stringify!(height)
        )
    );
}
extern "C" {
    pub fn tsk_avl_tree_int_init(self_: *mut tsk_avl_tree_int_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_avl_tree_int_free(self_: *mut tsk_avl_tree_int_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_avl_tree_int_print_state(self_: *mut tsk_avl_tree_int_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_avl_tree_int_insert(
        self_: *mut tsk_avl_tree_int_t,
        node: *mut tsk_avl_node_int_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_avl_tree_int_search(
        self_: *const tsk_avl_tree_int_t,
        key: i64,
    ) -> *mut tsk_avl_node_int_t;
}
extern "C" {
    pub fn tsk_avl_tree_int_ordered_nodes(
        self_: *const tsk_avl_tree_int_t,
        out: *mut *mut tsk_avl_node_int_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_avl_tree_int_get_root(self_: *const tsk_avl_tree_int_t) -> *mut tsk_avl_node_int_t;
}
extern "C" {
    pub fn tsk_search_sorted(array: *const f64, size: tsk_size_t, value: f64) -> tsk_size_t;
}
extern "C" {
    pub fn tsk_round(x: f64, ndigits: ::std::os::raw::c_uint) -> f64;
}
extern "C" {
    #[doc = "@brief Check if a number is ``TSK_UNKNOWN_TIME``\n\n@rst\nUnknown time values in tskit are represented by a particular NaN value. Since NaN values\nare not equal to each other by definition, a simple comparison like\n``mutation.time == TSK_UNKNOWN_TIME`` will fail even if the mutation's time is\nTSK_UNKNOWN_TIME. This function compares the underlying bit representation of a double\nvalue and returns true iff it is equal to the specific NaN value\n:c:macro:`TSK_UNKNOWN_TIME`.\n@endrst\n\n@param val The number to check\n@return true if the number is ``TSK_UNKNOWN_TIME`` else false"]
    pub fn tsk_is_unknown_time(val: f64) -> bool;
}
extern "C" {
    pub fn tsk_isnan(val: f64) -> bool;
}
extern "C" {
    pub fn tsk_isfinite(val: f64) -> bool;
}
extern "C" {
    pub fn tsk_generate_uuid(
        dest: *mut ::std::os::raw::c_char,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_malloc(size: tsk_size_t) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_realloc(
        ptr: *mut ::std::os::raw::c_void,
        size: tsk_size_t,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_calloc(n: tsk_size_t, size: usize) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_memset(
        ptr: *mut ::std::os::raw::c_void,
        fill: ::std::os::raw::c_int,
        size: tsk_size_t,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_memcpy(
        dest: *mut ::std::os::raw::c_void,
        src: *const ::std::os::raw::c_void,
        size: tsk_size_t,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_memmove(
        dest: *mut ::std::os::raw::c_void,
        src: *const ::std::os::raw::c_void,
        size: tsk_size_t,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn tsk_memcmp(
        s1: *const ::std::os::raw::c_void,
        s2: *const ::std::os::raw::c_void,
        size: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_set_debug_stream(f: *mut FILE);
}
extern "C" {
    pub fn tsk_get_debug_stream() -> *mut FILE;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kaitem_t {
    pub type_: ::std::os::raw::c_int,
    pub key_len: usize,
    pub array_len: usize,
    pub key: *mut ::std::os::raw::c_char,
    pub borrowed_array: *const ::std::os::raw::c_void,
    pub array: *mut ::std::os::raw::c_void,
    pub key_start: usize,
    pub array_start: usize,
}
#[test]
fn bindgen_test_layout_kaitem_t() {
    const UNINIT: ::std::mem::MaybeUninit<kaitem_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<kaitem_t>(),
        64usize,
        concat!("Size of: ", stringify!(kaitem_t))
    );
    assert_eq!(
        ::std::mem::align_of::<kaitem_t>(),
        8usize,
        concat!("Alignment of ", stringify!(kaitem_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(type_)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).key_len) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(key_len)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).array_len) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(array_len)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(key)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).borrowed_array) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(borrowed_array)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(array)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).key_start) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(key_start)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).array_start) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(kaitem_t),
            "::",
            stringify!(array_start)
        )
    );
}
#[doc = "@brief A file-backed store of key-array values."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct kastore_t {
    pub flags: ::std::os::raw::c_int,
    pub mode: ::std::os::raw::c_int,
    pub file_version: [::std::os::raw::c_int; 2usize],
    pub num_items: usize,
    pub items: *mut kaitem_t,
    pub file: *mut FILE,
    pub file_size: usize,
    pub file_offset: ::std::os::raw::c_long,
    pub key_read_buffer: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_kastore_t() {
    const UNINIT: ::std::mem::MaybeUninit<kastore_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<kastore_t>(),
        64usize,
        concat!("Size of: ", stringify!(kastore_t))
    );
    assert_eq!(
        ::std::mem::align_of::<kastore_t>(),
        8usize,
        concat!("Alignment of ", stringify!(kastore_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mode) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(mode)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).file_version) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(file_version)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_items) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(num_items)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).items) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(items)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).file) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(file)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).file_size) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(file_size)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).file_offset) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(file_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).key_read_buffer) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(kastore_t),
            "::",
            stringify!(key_read_buffer)
        )
    );
}
extern "C" {
    #[doc = "@brief Open a store from a given file in read (\"r\"), write (\"w\") or\nappend (\"a\") mode.\n\n@rst\nIn read mode, a store can be queried using the :ref:`get functions\n<sec_c_api_get>` and any attempts to write to the store will return an error.\nIn write and append mode, the store can written to using the :ref:`put\nfunctions <sec_c_api_put>` and any attempt to read will return an error.\n\nAfter :c:func:`kastore_open` has been called on a particular store,\n:c:func:`kastore_close` must be called to avoid leaking memory. This must also\nbe done when :c:func:`kastore_open` returns an error.\n\nWhen opened in read-mode, the default is to read key/array values from file\non demand. This is useful when a subset of the data is required and we don't\nwish to read the entire file. If the entire file is to be read, the\n``KAS_READ_ALL`` flag may be specified to improve performance.\n\nFlags**\n\nKAS_READ_ALL\nIf this option is specified, read the entire file at\nopen time. This will give slightly better performance as the file can\nbe read sequentially in a single pass.\n\nKAS_GET_TAKES_OWNERSHIP\nIf this option is specified, all ``get`` operations will transfer\nownership of the array to the caller. ``kastore`` will not ``free``\nthe array memory and this is the responsibility of the caller.\nIf ``get`` is called on the same key multiple times, a new buffer will be\nreturned each time. Note that second and subsequent ``get`` calls\non a given key will result in ``seek`` operations even when the\nKAS_READ_ALL flag is set, and will therefore fail on unseekable\nstreams.\n\n@endrst\n\n@param self A pointer to a kastore object.\n@param filename The file path to open.\n@param mode The open mode: can be read (\"r\"), write (\"w\") or append (\"a\").\n@param flags The open flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_open(
        self_: *mut kastore_t,
        filename: *const ::std::os::raw::c_char,
        mode: *const ::std::os::raw::c_char,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Open a store from a given FILE pointer.\n\n@rst\nBehaviour, mode and flags follow that of :c:func:`kastore_open`,\nexcept append mode is not supported.\nThe ``file`` argument must be opened in an appropriate mode (e.g. \"r\"\nfor a kastore in \"r\" mode).  Files open with other modes will result\nin KAS_ERR_IO being returned when read/write operations are attempted.\n\nThe FILE will not be closed when :c:func:`kastore_close` is called.\nIf the KAS_READ_ALL flag is supplied, no ``seek`` operations will be\nperformed on the FILE and so streams such as stdin, FIFOs etc are\nsupported. The FILE pointer will be positioned exactly at the end\nof the kastore encoded bytes once reading is completed, and reading\nmultiple stores from the same FILE sequentially is fully supported.\n@endrst\n\n@param self A pointer to a kastore object.\n@param file The FILE* to read/write the store from/to.\n@param mode The open mode: can be read (\"r\") or write (\"w\").\n@param flags The open flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_openf(
        self_: *mut kastore_t,
        file: *mut FILE,
        mode: *const ::std::os::raw::c_char,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Close an opened store, freeing all resources.\n\nAny store that has been opened must be closed to avoid memory leaks\n(including cases in which errors have occured). It is not an error to\ncall ``kastore_close`` multiple times on the same object, but\n``kastore_open`` must be called before ``kastore_close``.\n\n@param self A pointer to a kastore object.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_close(self_: *mut kastore_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Return 1 if the store contains the specified key and 0 if it does not.\n\n@rst\nQueries the store for the specified key and returns 1 if it exists. If the\nkey does not exist, 0 is returned. If an error occurs (for example, if querying\nthe store while it is in write-mode), a negative value is returned.\n\nFor keys that are standard NULL terminated strings, the :c:func:`kastore_containss`\nfunction may be more convenient.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@return Return 1 if the key is present and 0 if it does not. If an error occurs,\nreturn a negative value."]
    pub fn kastore_contains(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        key_len: usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Return 1 if the store contains the specified NULL terminated key\nand 0 if it does not.\n\n@rst\nQueries the store for the specified key, which must be a NULL terminated string,\nand returns 1 if it exists. If the\nkey does not exist, 0 is returned. If an error occurs (for example, if querying\nthe store while it is in write-mode), a negative value is returned.\nthe array in the specified destination pointers.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@return Return 1 if the key is present and 0 if it does not. If an error occurs,\nreturn a negative value."]
    pub fn kastore_containss(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the array for the specified key.\n\n@rst\nQueries the store for the specified key and stores pointers to the memory for\nthe corresponding array, the number of elements in this array and the type of\nthe array in the specified destination pointers. This is the most general form\nof ``get`` query in kastore, as non NULL-terminated strings can be used as\nkeys and the resulting array is returned in a generic pointer. When standard C\nstrings are used as keys and the type of the array is known, it is more\nconvenient to use the :ref:`typed variants <sec_c_api_typed_get>` of this function.\n\nThe returned array points to memory that is internally managed by the store\nand must not be freed or modified. The pointer is guaranteed to be valid\nuntil :c:func:`kastore_close` is called.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@param array The destination pointer for the array.\n@param array_len The destination pointer for the number of elements\nin the array.\n@param type The destination pointer for the type code of the array.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_get(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        key_len: usize,
        array: *mut *mut ::std::os::raw::c_void,
        array_len: *mut usize,
        type_: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the array for the specified NULL-terminated key.\n\n@rst\nAs for :c:func:`kastore_get()` except the key is a NULL-terminated string.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param array The destination pointer for the array.\n@param array_len The destination pointer for the number of elements\nin the array.\n@param type The destination pointer for the type code of the array.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_gets(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut ::std::os::raw::c_void,
        array_len: *mut usize,
        type_: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@defgroup TYPED_GETS_GROUP Typed get functions.\n@{"]
    pub fn kastore_gets_int8(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut i8,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_uint8(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut u8,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_int16(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut i16,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_uint16(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut u16,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_int32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut i32,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_uint32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut u32,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_int64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut i64,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_uint64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut u64,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_float32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut f32,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_gets_float64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut *mut f64,
        array_len: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Insert the specified key-array pair into the store.\n\n@rst\nA key with the specified length is inserted into the store and associated with\nan array of the specified type and number of elements. The contents of the\nspecified key and array are copied unless the KAS_BORROWS_ARRAY flag is specified.\nIf KAS_BORROWS_ARRAY is specified the array buffer must persist until the\nkastore is closed.\nKeys can be any sequence of bytes but must be at least one byte long and be\nunique. There is no restriction on the contents of arrays. This is the most\ngeneral form of ``put`` operation in kastore; when the type of the array\nis known and the keys are standard C strings, it is usually more convenient\nto use the :ref:`typed variants <sec_c_api_typed_put>` of this function.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@param array The array.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags, only KAS_BORROWS_ARRAY or 0 is a valid.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_put(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        key_len: usize,
        array: *const ::std::os::raw::c_void,
        array_len: usize,
        type_: ::std::os::raw::c_int,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Insert the specified NULL terminated key and array pair into the store.\n\n@rst\nAs for :c:func:`kastore_put` except the key must be NULL-terminated C string.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param array The array.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags, only KAS_BORROWS_ARRAY or 0 is a valid.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_puts(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const ::std::os::raw::c_void,
        array_len: usize,
        type_: ::std::os::raw::c_int,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@defgroup TYPED_PUTS_GROUP Typed put functions.\n@{"]
    pub fn kastore_puts_int8(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const i8,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_uint8(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const u8,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_int16(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const i16,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_uint16(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const u16,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_int32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const i32,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_uint32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const u32,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_int64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const i64,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_uint64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const u64,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_float32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const f32,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_puts_float64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *const f64,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Insert the specified key-array pair into the store, transferring ownership\nof the malloced array buffer to the store (own-put).\n\n@rst\nA key with the specified length is inserted into the store and associated with\nan array of the specified type and number of elements. The contents of the\nspecified key is copied, but the array buffer is taken directly and freed when\nthe store is closed. The array buffer must be a pointer returned by ``malloc``\nor ``calloc``. Ownership of the buffer is not taken unless the function returns\nsuccessfully.\n\nApart from taking ownership of the array buffer, the semantics of this\nfunction are identical to :c:func:`kastore_put`.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param key_len The length of the key.\n@param array The array. Must be a pointer returned by malloc/calloc.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags. Currently unused.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_oput(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        key_len: usize,
        array: *mut ::std::os::raw::c_void,
        array_len: usize,
        type_: ::std::os::raw::c_int,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Insert the specified NULL terminated key and array pair into the store,\ntransferring ownership of the malloced array buffer to the store (own-put).\n\n@rst\nAs for :c:func:`kastore_oput` except the key must be NULL-terminated C string.\n@endrst\n\n@param self A pointer to a kastore object.\n@param key The key.\n@param array The array. Must be a pointer returned by malloc/calloc.\n@param array_len The number of elements in the array.\n@param type The type of the array.\n@param flags The insertion flags. Currently unused.\n@return Return 0 on success or a negative value on failure."]
    pub fn kastore_oputs(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut ::std::os::raw::c_void,
        array_len: usize,
        type_: ::std::os::raw::c_int,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@defgroup TYPED_OPUTS_GROUP Typed own-and-put functions.\n@{"]
    pub fn kastore_oputs_int8(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut i8,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_uint8(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut u8,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_int16(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut i16,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_uint16(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut u16,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_int32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut i32,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_uint32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut u32,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_int64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut i64,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_uint64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut u64,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_float32(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut f32,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn kastore_oputs_float64(
        self_: *mut kastore_t,
        key: *const ::std::os::raw::c_char,
        array: *mut f64,
        array_len: usize,
        flags: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn kastore_print_state(self_: *mut kastore_t, out: *mut FILE);
}
#[doc = "@brief A single individual defined by a row in the individual table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\nan individual and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_individual_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Bitwise flags."]
    pub flags: tsk_flags_t,
    #[doc = " @brief Spatial location. The number of dimensions is defined by\n ``location_length``."]
    pub location: *const f64,
    #[doc = " @brief Number of spatial dimensions."]
    pub location_length: tsk_size_t,
    #[doc = " @brief IDs of the parents. The number of parents given by ``parents_length``"]
    pub parents: *mut tsk_id_t,
    #[doc = " @brief Number of parents."]
    pub parents_length: tsk_size_t,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Size of the metadata in bytes."]
    pub metadata_length: tsk_size_t,
    #[doc = " @brief An array of the nodes associated with this individual"]
    pub nodes: *const tsk_id_t,
    #[doc = " @brief The number of nodes associated with this individual"]
    pub nodes_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_individual_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_individual_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_individual_t>(),
        72usize,
        concat!("Size of: ", stringify!(tsk_individual_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_individual_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_individual_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).location) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(location)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).location_length) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(location_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parents) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(parents)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parents_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(parents_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).nodes_length) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_t),
            "::",
            stringify!(nodes_length)
        )
    );
}
#[doc = "@brief A single node defined by a row in the node table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na node and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_node_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Bitwise flags."]
    pub flags: tsk_flags_t,
    #[doc = " @brief Time."]
    pub time: f64,
    #[doc = " @brief Population ID."]
    pub population: tsk_id_t,
    #[doc = " @brief Individual ID."]
    pub individual: tsk_id_t,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Size of the metadata in bytes."]
    pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_node_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_node_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_node_t>(),
        40usize,
        concat!("Size of: ", stringify!(tsk_node_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_node_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_node_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).population) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(population)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individual) as usize - ptr as usize },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(individual)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_t),
            "::",
            stringify!(metadata_length)
        )
    );
}
#[doc = "@brief A single edge defined by a row in the edge table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\nan edge and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_edge_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Parent node ID."]
    pub parent: tsk_id_t,
    #[doc = " @brief Child node ID."]
    pub child: tsk_id_t,
    #[doc = " @brief Left coordinate."]
    pub left: f64,
    #[doc = " @brief Right coordinate."]
    pub right: f64,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Size of the metadata in bytes."]
    pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_edge_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_edge_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_edge_t>(),
        48usize,
        concat!("Size of: ", stringify!(tsk_edge_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_edge_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_edge_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).child) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(child)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(right)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_t),
            "::",
            stringify!(metadata_length)
        )
    );
}
#[doc = "@brief A single mutation defined by a row in the mutation table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na mutation and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_mutation_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Site ID."]
    pub site: tsk_id_t,
    #[doc = " @brief Node ID."]
    pub node: tsk_id_t,
    #[doc = " @brief Parent mutation ID."]
    pub parent: tsk_id_t,
    #[doc = " @brief Mutation time."]
    pub time: f64,
    #[doc = " @brief Derived state."]
    pub derived_state: *const ::std::os::raw::c_char,
    #[doc = " @brief Size of the derived state in bytes."]
    pub derived_state_length: tsk_size_t,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Size of the metadata in bytes."]
    pub metadata_length: tsk_size_t,
    #[doc = " @brief The ID of the edge that this mutation lies on, or TSK_NULL\nif there is no corresponding edge."]
    pub edge: tsk_id_t,
}
#[test]
fn bindgen_test_layout_tsk_mutation_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_mutation_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_mutation_t>(),
        64usize,
        concat!("Size of: ", stringify!(tsk_mutation_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_mutation_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_mutation_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(site)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).derived_state) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(derived_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).derived_state_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(derived_state_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edge) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_t),
            "::",
            stringify!(edge)
        )
    );
}
#[doc = "@brief A single site defined by a row in the site table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na site and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_site_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Position coordinate."]
    pub position: f64,
    #[doc = " @brief Ancestral state."]
    pub ancestral_state: *const ::std::os::raw::c_char,
    #[doc = " @brief Ancestral state length in bytes."]
    pub ancestral_state_length: tsk_size_t,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Metadata length in bytes."]
    pub metadata_length: tsk_size_t,
    #[doc = " @brief An array of this site's mutations"]
    pub mutations: *const tsk_mutation_t,
    #[doc = " @brief The number of mutations at this site"]
    pub mutations_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_site_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_site_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_site_t>(),
        64usize,
        concat!("Size of: ", stringify!(tsk_site_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_site_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_site_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).position) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(position)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(ancestral_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(ancestral_state_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mutations) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(mutations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mutations_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_t),
            "::",
            stringify!(mutations_length)
        )
    );
}
#[doc = "@brief A single migration defined by a row in the migration table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na migration and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_migration_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Source population ID."]
    pub source: tsk_id_t,
    #[doc = " @brief Destination population ID."]
    pub dest: tsk_id_t,
    #[doc = " @brief Node ID."]
    pub node: tsk_id_t,
    #[doc = " @brief Left coordinate."]
    pub left: f64,
    #[doc = " @brief Right coordinate."]
    pub right: f64,
    #[doc = " @brief Time."]
    pub time: f64,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Size of the metadata in bytes."]
    pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_migration_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_migration_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_migration_t>(),
        56usize,
        concat!("Size of: ", stringify!(tsk_migration_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_migration_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_migration_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(source)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dest) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(dest)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(right)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_t),
            "::",
            stringify!(metadata_length)
        )
    );
}
#[doc = "@brief A single population defined by a row in the population table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na population and its properties.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_population_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief Metadata."]
    pub metadata: *const ::std::os::raw::c_char,
    #[doc = " @brief Metadata length in bytes."]
    pub metadata_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_population_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_population_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_population_t>(),
        24usize,
        concat!("Size of: ", stringify!(tsk_population_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_population_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_population_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_t),
            "::",
            stringify!(metadata_length)
        )
    );
}
#[doc = "@brief A single provenance defined by a row in the provenance table.\n\n@rst\nSee the :ref:`data model <sec_data_model_definitions>` section for the definition of\na provenance object and its properties. See the :ref:`sec_provenance` section\nfor more information on how provenance records should be structured.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_provenance_t {
    #[doc = " @brief Non-negative ID value corresponding to table row."]
    pub id: tsk_id_t,
    #[doc = " @brief The timestamp."]
    pub timestamp: *const ::std::os::raw::c_char,
    #[doc = " @brief The timestamp length in bytes."]
    pub timestamp_length: tsk_size_t,
    #[doc = " @brief The record."]
    pub record: *const ::std::os::raw::c_char,
    #[doc = " @brief The record length in bytes."]
    pub record_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_provenance_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_provenance_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_provenance_t>(),
        40usize,
        concat!("Size of: ", stringify!(tsk_provenance_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_provenance_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_provenance_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_t),
            "::",
            stringify!(id)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_t),
            "::",
            stringify!(timestamp)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).timestamp_length) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_t),
            "::",
            stringify!(timestamp_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).record) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_t),
            "::",
            stringify!(record)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).record_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_t),
            "::",
            stringify!(record_length)
        )
    );
}
#[doc = "@brief The individual table.\n\n@rst\nSee the individual :ref:`table definition <sec_individual_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_individual_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    #[doc = " @brief The total length of the location column."]
    pub location_length: tsk_size_t,
    pub max_location_length: tsk_size_t,
    pub max_location_length_increment: tsk_size_t,
    #[doc = " @brief The total length of the parent column."]
    pub parents_length: tsk_size_t,
    pub max_parents_length: tsk_size_t,
    pub max_parents_length_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The flags column."]
    pub flags: *mut tsk_flags_t,
    #[doc = " @brief The location column."]
    pub location: *mut f64,
    #[doc = " @brief The location_offset column."]
    pub location_offset: *mut tsk_size_t,
    #[doc = " @brief The parents column."]
    pub parents: *mut tsk_id_t,
    #[doc = " @brief The parents_offset column."]
    pub parents_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_individual_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_individual_table_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_individual_table_t>(),
        168usize,
        concat!("Size of: ", stringify!(tsk_individual_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_individual_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_individual_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).location_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(location_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_location_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_location_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_location_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_location_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parents_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(parents_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_parents_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_parents_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_parents_length_increment) as usize - ptr as usize
        },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_parents_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).location) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(location)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).location_offset) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(location_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parents) as usize - ptr as usize },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(parents)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parents_offset) as usize - ptr as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(parents_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        144usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        152usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        160usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_individual_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
}
#[doc = "@brief The node table.\n\n@rst\nSee the node :ref:`table definition <sec_node_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_node_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The flags column."]
    pub flags: *mut tsk_flags_t,
    #[doc = " @brief The time column."]
    pub time: *mut f64,
    #[doc = " @brief The population column."]
    pub population: *mut tsk_id_t,
    #[doc = " @brief The individual column."]
    pub individual: *mut tsk_id_t,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_node_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_node_table_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_node_table_t>(),
        112usize,
        concat!("Size of: ", stringify!(tsk_node_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_node_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_node_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(flags)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).population) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(population)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individual) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(individual)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_node_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
}
#[doc = "@brief The edge table.\n\n@rst\nSee the edge :ref:`table definition <sec_edge_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_edge_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The left column."]
    pub left: *mut f64,
    #[doc = " @brief The right column."]
    pub right: *mut f64,
    #[doc = " @brief The parent column."]
    pub parent: *mut tsk_id_t,
    #[doc = " @brief The child column."]
    pub child: *mut tsk_id_t,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
    #[doc = " @brief Flags for this table"]
    pub options: tsk_flags_t,
}
#[test]
fn bindgen_test_layout_tsk_edge_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_edge_table_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_edge_table_t>(),
        120usize,
        concat!("Size of: ", stringify!(tsk_edge_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_edge_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_edge_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(right)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).child) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(child)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_table_t),
            "::",
            stringify!(options)
        )
    );
}
#[doc = "@brief The migration table.\n\n@rst\nSee the migration :ref:`table definition <sec_migration_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_migration_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The source column."]
    pub source: *mut tsk_id_t,
    #[doc = " @brief The dest column."]
    pub dest: *mut tsk_id_t,
    #[doc = " @brief The node column."]
    pub node: *mut tsk_id_t,
    #[doc = " @brief The left column."]
    pub left: *mut f64,
    #[doc = " @brief The right column."]
    pub right: *mut f64,
    #[doc = " @brief The time column."]
    pub time: *mut f64,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_migration_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_migration_table_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_migration_table_t>(),
        128usize,
        concat!("Size of: ", stringify!(tsk_migration_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_migration_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_migration_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).source) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(source)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).dest) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(dest)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(right)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_migration_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
}
#[doc = "@brief The site table.\n\n@rst\nSee the site :ref:`table definition <sec_site_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_site_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    pub ancestral_state_length: tsk_size_t,
    pub max_ancestral_state_length: tsk_size_t,
    pub max_ancestral_state_length_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The position column."]
    pub position: *mut f64,
    #[doc = " @brief The ancestral_state column."]
    pub ancestral_state: *mut ::std::os::raw::c_char,
    #[doc = " @brief The ancestral_state_offset column."]
    pub ancestral_state_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_site_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_site_table_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_site_table_t>(),
        128usize,
        concat!("Size of: ", stringify!(tsk_site_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_site_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_site_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(ancestral_state_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_ancestral_state_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(max_ancestral_state_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_ancestral_state_length_increment) as usize
                - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(max_ancestral_state_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).position) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(position)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(ancestral_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).ancestral_state_offset) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(ancestral_state_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
}
#[doc = "@brief The mutation table.\n\n@rst\nSee the mutation :ref:`table definition <sec_mutation_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_mutation_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    pub derived_state_length: tsk_size_t,
    pub max_derived_state_length: tsk_size_t,
    pub max_derived_state_length_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The node column."]
    pub node: *mut tsk_id_t,
    #[doc = " @brief The site column."]
    pub site: *mut tsk_id_t,
    #[doc = " @brief The parent column."]
    pub parent: *mut tsk_id_t,
    #[doc = " @brief The time column."]
    pub time: *mut f64,
    #[doc = " @brief The derived_state column."]
    pub derived_state: *mut ::std::os::raw::c_char,
    #[doc = " @brief The derived_state_offset column."]
    pub derived_state_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_mutation_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_mutation_table_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_mutation_table_t>(),
        152usize,
        concat!("Size of: ", stringify!(tsk_mutation_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_mutation_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_mutation_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).derived_state_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(derived_state_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_derived_state_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(max_derived_state_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_derived_state_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(max_derived_state_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(site)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).derived_state) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(derived_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).derived_state_offset) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(derived_state_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        144usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_mutation_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
}
#[doc = "@brief The population table.\n\n@rst\nSee the population :ref:`table definition <sec_population_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_population_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    #[doc = " @brief The total length of the metadata column."]
    pub metadata_length: tsk_size_t,
    pub max_metadata_length: tsk_size_t,
    pub max_metadata_length_increment: tsk_size_t,
    pub metadata_schema_length: tsk_size_t,
    #[doc = " @brief The metadata column."]
    pub metadata: *mut ::std::os::raw::c_char,
    #[doc = " @brief The metadata_offset column."]
    pub metadata_offset: *mut tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_tsk_population_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_population_table_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_population_table_t>(),
        80usize,
        concat!("Size of: ", stringify!(tsk_population_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_population_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_population_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_metadata_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(max_metadata_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_metadata_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(max_metadata_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_offset) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(metadata_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_population_table_t),
            "::",
            stringify!(metadata_schema)
        )
    );
}
#[doc = "@brief The provenance table.\n\n@rst\nSee the provenance :ref:`table definition <sec_provenance_table_definition>` for\ndetails of the columns in this table.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_provenance_table_t {
    #[doc = " @brief The number of rows in this table."]
    pub num_rows: tsk_size_t,
    pub max_rows: tsk_size_t,
    pub max_rows_increment: tsk_size_t,
    #[doc = " @brief The total length of the timestamp column."]
    pub timestamp_length: tsk_size_t,
    pub max_timestamp_length: tsk_size_t,
    pub max_timestamp_length_increment: tsk_size_t,
    #[doc = " @brief The total length of the record column."]
    pub record_length: tsk_size_t,
    pub max_record_length: tsk_size_t,
    pub max_record_length_increment: tsk_size_t,
    #[doc = " @brief The timestamp column."]
    pub timestamp: *mut ::std::os::raw::c_char,
    #[doc = " @brief The timestamp_offset column."]
    pub timestamp_offset: *mut tsk_size_t,
    #[doc = " @brief The record column."]
    pub record: *mut ::std::os::raw::c_char,
    #[doc = " @brief The record_offset column."]
    pub record_offset: *mut tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_provenance_table_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_provenance_table_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_provenance_table_t>(),
        104usize,
        concat!("Size of: ", stringify!(tsk_provenance_table_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_provenance_table_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_provenance_table_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_rows) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(num_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(max_rows)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_rows_increment) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(max_rows_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).timestamp_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(timestamp_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_timestamp_length) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(max_timestamp_length)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).max_timestamp_length_increment) as usize - ptr as usize
        },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(max_timestamp_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).record_length) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(record_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_record_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(max_record_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_record_length_increment) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(max_record_length_increment)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).timestamp) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(timestamp)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).timestamp_offset) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(timestamp_offset)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).record) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(record)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).record_offset) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_provenance_table_t),
            "::",
            stringify!(record_offset)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_reference_sequence_t {
    pub data: *mut ::std::os::raw::c_char,
    pub data_length: tsk_size_t,
    pub url: *mut ::std::os::raw::c_char,
    pub url_length: tsk_size_t,
    pub metadata: *mut ::std::os::raw::c_char,
    pub metadata_length: tsk_size_t,
    pub metadata_schema: *mut ::std::os::raw::c_char,
    pub metadata_schema_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_reference_sequence_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_reference_sequence_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_reference_sequence_t>(),
        64usize,
        concat!("Size of: ", stringify!(tsk_reference_sequence_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_reference_sequence_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_reference_sequence_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(data)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).data_length) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(data_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).url) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(url)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).url_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(url_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(metadata_schema)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_reference_sequence_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
}
#[doc = "@brief A collection of tables defining the data for a tree sequence."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_table_collection_t {
    #[doc = " @brief The sequence length defining the tree sequence's coordinate space"]
    pub sequence_length: f64,
    pub file_uuid: *mut ::std::os::raw::c_char,
    #[doc = " @brief The units of the time dimension"]
    pub time_units: *mut ::std::os::raw::c_char,
    pub time_units_length: tsk_size_t,
    #[doc = " @brief The tree-sequence metadata"]
    pub metadata: *mut ::std::os::raw::c_char,
    pub metadata_length: tsk_size_t,
    #[doc = " @brief The metadata schema"]
    pub metadata_schema: *mut ::std::os::raw::c_char,
    pub metadata_schema_length: tsk_size_t,
    pub reference_sequence: tsk_reference_sequence_t,
    #[doc = " @brief The individual table"]
    pub individuals: tsk_individual_table_t,
    #[doc = " @brief The node table"]
    pub nodes: tsk_node_table_t,
    #[doc = " @brief The edge table"]
    pub edges: tsk_edge_table_t,
    #[doc = " @brief The migration table"]
    pub migrations: tsk_migration_table_t,
    #[doc = " @brief The site table"]
    pub sites: tsk_site_table_t,
    #[doc = " @brief The mutation table"]
    pub mutations: tsk_mutation_table_t,
    #[doc = " @brief The population table"]
    pub populations: tsk_population_table_t,
    #[doc = " @brief The provenance table"]
    pub provenances: tsk_provenance_table_t,
    pub indexes: tsk_table_collection_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_table_collection_t__bindgen_ty_1 {
    pub edge_insertion_order: *mut tsk_id_t,
    pub edge_removal_order: *mut tsk_id_t,
    pub num_edges: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_table_collection_t__bindgen_ty_1() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_table_collection_t__bindgen_ty_1> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_table_collection_t__bindgen_ty_1>(),
        24usize,
        concat!(
            "Size of: ",
            stringify!(tsk_table_collection_t__bindgen_ty_1)
        )
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_table_collection_t__bindgen_ty_1>(),
        8usize,
        concat!(
            "Alignment of ",
            stringify!(tsk_table_collection_t__bindgen_ty_1)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edge_insertion_order) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t__bindgen_ty_1),
            "::",
            stringify!(edge_insertion_order)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edge_removal_order) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t__bindgen_ty_1),
            "::",
            stringify!(edge_removal_order)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_edges) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t__bindgen_ty_1),
            "::",
            stringify!(num_edges)
        )
    );
}
#[test]
fn bindgen_test_layout_tsk_table_collection_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_table_collection_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_table_collection_t>(),
        1144usize,
        concat!("Size of: ", stringify!(tsk_table_collection_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_table_collection_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_table_collection_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sequence_length) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(sequence_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).file_uuid) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(file_uuid)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time_units) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(time_units)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time_units_length) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(time_units_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(metadata)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_length) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(metadata_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(metadata_schema)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).metadata_schema_length) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(metadata_schema_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).reference_sequence) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(reference_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individuals) as usize - ptr as usize },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(individuals)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
        296usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edges) as usize - ptr as usize },
        408usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(edges)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).migrations) as usize - ptr as usize },
        528usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(migrations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sites) as usize - ptr as usize },
        656usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mutations) as usize - ptr as usize },
        784usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(mutations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).populations) as usize - ptr as usize },
        936usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(populations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).provenances) as usize - ptr as usize },
        1016usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(provenances)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).indexes) as usize - ptr as usize },
        1120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_table_collection_t),
            "::",
            stringify!(indexes)
        )
    );
}
#[doc = "@brief A bookmark recording the position of all the tables in a table collection."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_bookmark_t {
    #[doc = " @brief The position in the individual table."]
    pub individuals: tsk_size_t,
    #[doc = " @brief The position in the node table."]
    pub nodes: tsk_size_t,
    #[doc = " @brief The position in the edge table."]
    pub edges: tsk_size_t,
    #[doc = " @brief The position in the migration table."]
    pub migrations: tsk_size_t,
    #[doc = " @brief The position in the site table."]
    pub sites: tsk_size_t,
    #[doc = " @brief The position in the mutation table."]
    pub mutations: tsk_size_t,
    #[doc = " @brief The position in the population table."]
    pub populations: tsk_size_t,
    #[doc = " @brief The position in the provenance table."]
    pub provenances: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_bookmark_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_bookmark_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_bookmark_t>(),
        64usize,
        concat!("Size of: ", stringify!(tsk_bookmark_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_bookmark_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_bookmark_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individuals) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(individuals)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edges) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(edges)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).migrations) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(migrations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sites) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mutations) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(mutations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).populations) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(populations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).provenances) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_bookmark_t),
            "::",
            stringify!(provenances)
        )
    );
}
#[doc = "@brief Low-level table sorting method."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_table_sorter_t {
    #[doc = " @brief The input tables that are being sorted."]
    pub tables: *mut tsk_table_collection_t,
    #[doc = " @brief The edge sorting function. If set to NULL, edges are not sorted."]
    pub sort_edges: ::std::option::Option<
        unsafe extern "C" fn(
            self_: *mut _tsk_table_sorter_t,
            start: tsk_size_t,
        ) -> ::std::os::raw::c_int,
    >,
    #[doc = " @brief The mutation sorting function."]
    pub sort_mutations: ::std::option::Option<
        unsafe extern "C" fn(self_: *mut _tsk_table_sorter_t) -> ::std::os::raw::c_int,
    >,
    #[doc = " @brief The individual sorting function."]
    pub sort_individuals: ::std::option::Option<
        unsafe extern "C" fn(self_: *mut _tsk_table_sorter_t) -> ::std::os::raw::c_int,
    >,
    #[doc = " @brief An opaque pointer for use by client code"]
    pub user_data: *mut ::std::os::raw::c_void,
    #[doc = " @brief Mapping from input site IDs to output site IDs"]
    pub site_id_map: *mut tsk_id_t,
}
#[test]
fn bindgen_test_layout__tsk_table_sorter_t() {
    const UNINIT: ::std::mem::MaybeUninit<_tsk_table_sorter_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_tsk_table_sorter_t>(),
        48usize,
        concat!("Size of: ", stringify!(_tsk_table_sorter_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_tsk_table_sorter_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_tsk_table_sorter_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_table_sorter_t),
            "::",
            stringify!(tables)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sort_edges) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_table_sorter_t),
            "::",
            stringify!(sort_edges)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sort_mutations) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_table_sorter_t),
            "::",
            stringify!(sort_mutations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sort_individuals) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_table_sorter_t),
            "::",
            stringify!(sort_individuals)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_table_sorter_t),
            "::",
            stringify!(user_data)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site_id_map) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_table_sorter_t),
            "::",
            stringify!(site_id_map)
        )
    );
}
#[doc = "@brief Low-level table sorting method."]
pub type tsk_table_sorter_t = _tsk_table_sorter_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_identity_segment_t {
    pub left: f64,
    pub right: f64,
    pub next: *mut _tsk_identity_segment_t,
    pub node: tsk_id_t,
}
#[test]
fn bindgen_test_layout__tsk_identity_segment_t() {
    const UNINIT: ::std::mem::MaybeUninit<_tsk_identity_segment_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_tsk_identity_segment_t>(),
        32usize,
        concat!("Size of: ", stringify!(_tsk_identity_segment_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_tsk_identity_segment_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_tsk_identity_segment_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_identity_segment_t),
            "::",
            stringify!(left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_identity_segment_t),
            "::",
            stringify!(right)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_identity_segment_t),
            "::",
            stringify!(next)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_identity_segment_t),
            "::",
            stringify!(node)
        )
    );
}
pub type tsk_identity_segment_t = _tsk_identity_segment_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_identity_segment_list_t {
    pub num_segments: tsk_size_t,
    pub total_span: f64,
    pub head: *mut tsk_identity_segment_t,
    pub tail: *mut tsk_identity_segment_t,
}
#[test]
fn bindgen_test_layout_tsk_identity_segment_list_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_identity_segment_list_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_identity_segment_list_t>(),
        32usize,
        concat!("Size of: ", stringify!(tsk_identity_segment_list_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_identity_segment_list_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_identity_segment_list_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_segments) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segment_list_t),
            "::",
            stringify!(num_segments)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).total_span) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segment_list_t),
            "::",
            stringify!(total_span)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segment_list_t),
            "::",
            stringify!(head)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segment_list_t),
            "::",
            stringify!(tail)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_identity_segments_t {
    pub num_nodes: tsk_size_t,
    pub pair_map: tsk_avl_tree_int_t,
    pub num_segments: tsk_size_t,
    pub total_span: f64,
    pub heap: tsk_blkalloc_t,
    pub store_segments: bool,
    pub store_pairs: bool,
}
#[test]
fn bindgen_test_layout_tsk_identity_segments_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_identity_segments_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_identity_segments_t>(),
        144usize,
        concat!("Size of: ", stringify!(tsk_identity_segments_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_identity_segments_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_identity_segments_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(num_nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).pair_map) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(pair_map)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_segments) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(num_segments)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).total_span) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(total_span)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).heap) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(heap)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).store_segments) as usize - ptr as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(store_segments)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).store_pairs) as usize - ptr as usize },
        137usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_identity_segments_t),
            "::",
            stringify!(store_pairs)
        )
    );
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_individual_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_init(
        self_: *mut tsk_individual_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_individual_table_t object.\n@return Always returns 0."]
    pub fn tsk_individual_table_free(self_: *mut tsk_individual_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this individual table.\n\n@rst\nAdd a new individual with the specified ``flags``, ``location``, ``parents`` and\n``metadata`` to the table. Copies of the ``location``, ``parents`` and ``metadata``\nparameters are taken immediately. See the :ref:`table definition\n<sec_individual_table_definition>` for details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param flags The bitwise flags for the new individual.\n@param location A pointer to a double array representing the spatial location\nof the new individual. Can be ``NULL`` if ``location_length`` is 0.\n@param location_length The number of dimensions in the locations position.\nNote this the number of elements in the corresponding double array\nnot the number of bytes.\n@param parents A pointer to a ``tsk_id`` array representing the parents\nof the new individual. Can be ``NULL`` if ``parents_length`` is 0.\n@param parents_length The number of parents.\nNote this the number of elements in the corresponding ``tsk_id`` array\nnot the number of bytes.\n@param metadata The metadata to be associated with the new individual. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added individual on success,\nor a negative value on failure."]
    pub fn tsk_individual_table_add_row(
        self_: *mut tsk_individual_table_t,
        flags: tsk_flags_t,
        location: *const f64,
        location_length: tsk_size_t,
        parents: *const tsk_id_t,
        parents_length: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``location``, ``parents`` and ``metadata``\nparameters are taken immediately. See the :ref:`table definition\n<sec_individual_table_definition>` for details of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param index The row to update.\n@param flags The bitwise flags for the individual.\n@param location A pointer to a double array representing the spatial location\nof the new individual. Can be ``NULL`` if ``location_length`` is 0.\n@param location_length The number of dimensions in the locations position.\nNote this the number of elements in the corresponding double array\nnot the number of bytes.\n@param parents A pointer to a ``tsk_id`` array representing the parents\nof the new individual. Can be ``NULL`` if ``parents_length`` is 0.\n@param parents_length The number of parents.\nNote this the number of elements in the corresponding ``tsk_id`` array\nnot the number of bytes.\n@param metadata The metadata to be associated with the new individual. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_update_row(
        self_: *mut tsk_individual_table_t,
        index: tsk_id_t,
        flags: tsk_flags_t,
        location: *const f64,
        location_length: tsk_size_t,
        parents: *const tsk_id_t,
        parents_length: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_individual_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_clear(self_: *mut tsk_individual_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_individual_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_truncate(
        self_: *mut tsk_individual_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object where rows are to be added.\n@param other A pointer to a tsk_individual_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_extend(
        self_: *mut tsk_individual_table_t,
        other: *const tsk_individual_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param other A pointer to a tsk_individual_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_individual_table_equals(
        self_: *const tsk_individual_table_t,
        other: *const tsk_individual_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n\nIndexes that are present are also copied to the destination table.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param dest A pointer to a tsk_individual_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised individual table. If not, it must be an\nuninitialised individual table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_copy(
        self_: *const tsk_individual_table_t,
        dest: *mut tsk_individual_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified individual struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_individual_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_get_row(
        self_: *const tsk_individual_table_t,
        index: tsk_id_t,
        row: *mut tsk_individual_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_set_metadata_schema(
        self_: *mut tsk_individual_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_individual_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_individual_table_print_state(self_: *const tsk_individual_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param flags The array of tsk_flag_t flag values to be copied.\n@param location The array of double location values to be copied.\n@param location_offset The array of tsk_size_t location offset values to be copied.\n@param parents The array of tsk_id_t parent values to be copied.\n@param parents_offset The array of tsk_size_t parent offset values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_set_columns(
        self_: *mut tsk_individual_table_t,
        num_rows: tsk_size_t,
        flags: *const tsk_flags_t,
        location: *const f64,
        location_offset: *const tsk_size_t,
        parents: *const tsk_id_t,
        parents_offset: *const tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays\n@param flags The array of tsk_flag_t flag values to be copied.\n@param location The array of double location values to be copied.\n@param location_offset The array of tsk_size_t location offset values to be copied.\n@param parents The array of tsk_id_t parent values to be copied.\n@param parents_offset The array of tsk_size_t parent offset values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_append_columns(
        self_: *mut tsk_individual_table_t,
        num_rows: tsk_size_t,
        flags: *const tsk_flags_t,
        location: *const f64,
        location_offset: *const tsk_size_t,
        parents: *const tsk_id_t,
        parents_offset: *const tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_set_max_rows_increment(
        self_: *mut tsk_individual_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_set_max_metadata_length_increment(
        self_: *mut tsk_individual_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the location column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_location_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_set_max_location_length_increment(
        self_: *mut tsk_individual_table_t,
        max_location_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the parents column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param max_parents_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_individual_table_set_max_parents_length_increment(
        self_: *mut tsk_individual_table_t,
        max_parents_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_individual_table_dump_text(
        self_: *const tsk_individual_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_node_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_init(
        self_: *mut tsk_node_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_node_table_t object.\n@return Always returns 0."]
    pub fn tsk_node_table_free(self_: *mut tsk_node_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this node table.\n\n@rst\nAdd a new node with the specified ``flags``, ``time``, ``population``,\n``individual`` and ``metadata`` to the table. A copy of the ``metadata`` parameter\nis taken immediately. See the :ref:`table definition <sec_node_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param flags The bitwise flags for the new node.\n@param time The time for the new node.\n@param population The population for the new node. Set to TSK_NULL if not\nknown.\n@param individual The individual for the new node. Set to TSK_NULL if not\nknown.\n@param metadata The metadata to be associated with the new node. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added node on success,\nor a negative value on failure."]
    pub fn tsk_node_table_add_row(
        self_: *mut tsk_node_table_t,
        flags: tsk_flags_t,
        time: f64,
        population: tsk_id_t,
        individual: tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_node_table_definition>` for details of the columns\nin this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param index The row to update.\n@param flags The bitwise flags for the node.\n@param time The time for the node.\n@param population The population for the node. Set to TSK_NULL if not known.\n@param individual The individual for the node. Set to TSK_NULL if not known.\n@param metadata The metadata to be associated with the node. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_update_row(
        self_: *mut tsk_node_table_t,
        index: tsk_id_t,
        flags: tsk_flags_t,
        time: f64,
        population: tsk_id_t,
        individual: tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_node_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_clear(self_: *mut tsk_node_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_node_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_truncate(
        self_: *mut tsk_node_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object where rows are to be added.\n@param other A pointer to a tsk_node_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_extend(
        self_: *mut tsk_node_table_t,
        other: *const tsk_node_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param other A pointer to a tsk_node_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_node_table_equals(
        self_: *const tsk_node_table_t,
        other: *const tsk_node_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the TSK_NO_INIT option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param dest A pointer to a tsk_node_table_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised node table. If not, it must\nbe an uninitialised node table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_copy(
        self_: *const tsk_node_table_t,
        dest: *mut tsk_node_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified node struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_node_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_get_row(
        self_: *const tsk_node_table_t,
        index: tsk_id_t,
        row: *mut tsk_node_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_node_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_set_metadata_schema(
        self_: *mut tsk_node_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_node_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_node_table_print_state(self_: *const tsk_node_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param flags The array of tsk_flag_t values to be copied.\n@param time The array of double time values to be copied.\n@param population The array of tsk_id_t population values to be copied.\n@param individual The array of tsk_id_t individual values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_set_columns(
        self_: *mut tsk_node_table_t,
        num_rows: tsk_size_t,
        flags: *const tsk_flags_t,
        time: *const f64,
        population: *const tsk_id_t,
        individual: *const tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays\n@param flags The array of tsk_flag_t values to be copied.\n@param time The array of double time values to be copied.\n@param population The array of tsk_id_t population values to be copied.\n@param individual The array of tsk_id_t individual values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_append_columns(
        self_: *mut tsk_node_table_t,
        num_rows: tsk_size_t,
        flags: *const tsk_flags_t,
        time: *const f64,
        population: *const tsk_id_t,
        individual: *const tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_set_max_rows_increment(
        self_: *mut tsk_node_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_node_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_node_table_set_max_metadata_length_increment(
        self_: *mut tsk_node_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_node_table_dump_text(
        self_: *const tsk_node_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_TABLE_NO_METADATA`\n@endrst\n\n@param self A pointer to an uninitialised tsk_edge_table_t object.\n@param options Allocation time options.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_init(
        self_: *mut tsk_edge_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_edge_table_t object.\n@return Always returns 0."]
    pub fn tsk_edge_table_free(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this edge table.\n\n@rst\nAdd a new edge with the specified ``left``, ``right``, ``parent``, ``child`` and\n``metadata`` to the table. See the :ref:`table definition <sec_edge_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param left The left coordinate for the new edge.\n@param right The right coordinate for the new edge.\n@param parent The parent node for the new edge.\n@param child The child node for the new edge.\n@param metadata The metadata to be associated with the new edge. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n\n@return Return the ID of the newly added edge on success,\nor a negative value on failure."]
    pub fn tsk_edge_table_add_row(
        self_: *mut tsk_edge_table_t,
        left: f64,
        right: f64,
        parent: tsk_id_t,
        child: tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_edge_table_definition>` for details of the columns\nin this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param index The row to update.\n@param left The left coordinate for the edge.\n@param right The right coordinate for the edge.\n@param parent The parent node for the edge.\n@param child The child node for the edge.\n@param metadata The metadata to be associated with the edge. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_update_row(
        self_: *mut tsk_edge_table_t,
        index: tsk_id_t,
        left: f64,
        right: f64,
        parent: tsk_id_t,
        child: tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_edge_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_clear(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_edge_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_truncate(
        self_: *mut tsk_edge_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is ``NULL``,\nappend the first ``num_rows`` from ``other`` to this table. Note that metadata is copied\nas-is and is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object where rows are to be added.\n@param other A pointer to a tsk_edge_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_extend(
        self_: *mut tsk_edge_table_t,
        other: *const tsk_edge_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param other A pointer to a tsk_edge_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_edge_table_equals(
        self_: *const tsk_edge_table_t,
        other: *const tsk_edge_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param dest A pointer to a tsk_edge_table_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised edge table. If not, it must\nbe an uninitialised edge table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_copy(
        self_: *const tsk_edge_table_t,
        dest: *mut tsk_edge_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified edge struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_edge_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_get_row(
        self_: *const tsk_edge_table_t,
        index: tsk_id_t,
        row: *mut tsk_edge_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_edge_table_t object.\n@param metadata_schema A pointer to a char array\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_set_metadata_schema(
        self_: *mut tsk_edge_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_edge_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_edge_table_print_state(self_: *const tsk_edge_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param child The array of tsk_id_t child values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_set_columns(
        self_: *mut tsk_edge_table_t,
        num_rows: tsk_size_t,
        left: *const f64,
        right: *const f64,
        parent: *const tsk_id_t,
        child: *const tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param child The array of tsk_id_t child values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied."]
    pub fn tsk_edge_table_append_columns(
        self_: *mut tsk_edge_table_t,
        num_rows: tsk_size_t,
        left: *const f64,
        right: *const f64,
        parent: *const tsk_id_t,
        child: *const tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_set_max_rows_increment(
        self_: *mut tsk_edge_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_set_max_metadata_length_increment(
        self_: *mut tsk_edge_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Squash adjacent edges in-place\n\n@rst\nSorts, then condenses the table into the smallest possible number of rows by\ncombining any adjacent edges. A pair of edges is said to be `adjacent` if\nthey have the same parent and child nodes, and if the left coordinate of\none of the edges is equal to the right coordinate of the other edge.\nThis process is performed in-place so that any set of adjacent edges is\nreplaced by a single edge. The new edge will have the same parent and child\nnode, a left coordinate equal to the smallest left coordinate in the set,\nand a right coordinate equal to the largest right coordinate in the set.\nThe new edge table will be sorted in the canonical order (P, C, L, R).\n\n.. note::\nNote that this method will fail if any edges have non-empty metadata.\n\n@endrst\n\n@param self A pointer to a tsk_edge_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_edge_table_squash(self_: *mut tsk_edge_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_edge_table_dump_text(
        self_: *const tsk_edge_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_migration_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_init(
        self_: *mut tsk_migration_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_migration_table_t object.\n@return Always returns 0."]
    pub fn tsk_migration_table_free(self_: *mut tsk_migration_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this migration table.\n\n@rst\nAdd a new migration with the specified ``left``, ``right``, ``node``,\n``source``, ``dest``, ``time`` and ``metadata`` to the table.\nSee the :ref:`table definition <sec_migration_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param left The left coordinate for the new migration.\n@param right The right coordinate for the new migration.\n@param node The node ID for the new migration.\n@param source The source population ID for the new migration.\n@param dest The destination population ID for the new migration.\n@param time The time for the new migration.\n@param metadata The metadata to be associated with the new migration. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n\n@return Return the ID of the newly added migration on success,\nor a negative value on failure."]
    pub fn tsk_migration_table_add_row(
        self_: *mut tsk_migration_table_t,
        left: f64,
        right: f64,
        node: tsk_id_t,
        source: tsk_id_t,
        dest: tsk_id_t,
        time: f64,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_migration_table_definition>` for details of the columns\nin this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param index The row to update.\n@param left The left coordinate for the migration.\n@param right The right coordinate for the migration.\n@param node The node ID for the migration.\n@param source The source population ID for the migration.\n@param dest The destination population ID for the migration.\n@param time The time for the migration.\n@param metadata The metadata to be associated with the migration. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_update_row(
        self_: *mut tsk_migration_table_t,
        index: tsk_id_t,
        left: f64,
        right: f64,
        node: tsk_id_t,
        source: tsk_id_t,
        dest: tsk_id_t,
        time: f64,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_migration_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_clear(self_: *mut tsk_migration_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_migration_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_truncate(
        self_: *mut tsk_migration_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object where rows are to be added.\n@param other A pointer to a tsk_migration_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_extend(
        self_: *mut tsk_migration_table_t,
        other: *const tsk_migration_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param other A pointer to a tsk_migration_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_migration_table_equals(
        self_: *const tsk_migration_table_t,
        other: *const tsk_migration_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param dest A pointer to a tsk_migration_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised migration table. If not, it must be an\nuninitialised migration table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_copy(
        self_: *const tsk_migration_table_t,
        dest: *mut tsk_migration_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified migration struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_migration_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_get_row(
        self_: *const tsk_migration_table_t,
        index: tsk_id_t,
        row: *mut tsk_migration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_migration_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_set_metadata_schema(
        self_: *mut tsk_migration_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_migration_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_migration_table_print_state(self_: *const tsk_migration_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param source The array of tsk_id_t source values to be copied.\n@param dest The array of tsk_id_t dest values to be copied.\n@param time The array of double time values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_set_columns(
        self_: *mut tsk_migration_table_t,
        num_rows: tsk_size_t,
        left: *const f64,
        right: *const f64,
        node: *const tsk_id_t,
        source: *const tsk_id_t,
        dest: *const tsk_id_t,
        time: *const f64,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays\n@param left The array of double left values to be copied.\n@param right The array of double right values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param source The array of tsk_id_t source values to be copied.\n@param dest The array of tsk_id_t dest values to be copied.\n@param time The array of double time values to be copied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_append_columns(
        self_: *mut tsk_migration_table_t,
        num_rows: tsk_size_t,
        left: *const f64,
        right: *const f64,
        node: *const tsk_id_t,
        source: *const tsk_id_t,
        dest: *const tsk_id_t,
        time: *const f64,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_set_max_rows_increment(
        self_: *mut tsk_migration_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_migration_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_migration_table_set_max_metadata_length_increment(
        self_: *mut tsk_migration_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_migration_table_dump_text(
        self_: *const tsk_migration_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_site_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_init(
        self_: *mut tsk_site_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_site_table_t object.\n@return Always returns 0."]
    pub fn tsk_site_table_free(self_: *mut tsk_site_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this site table.\n\n@rst\nAdd a new site with the specified ``position``, ``ancestral_state``\nand ``metadata`` to the table. Copies of ``ancestral_state`` and ``metadata``\nare immediately taken. See the :ref:`table definition <sec_site_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param position The position coordinate for the new site.\n@param ancestral_state The ancestral_state for the new site.\n@param ancestral_state_length The length of the ancestral_state in bytes.\n@param metadata The metadata to be associated with the new site. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added site on success,\nor a negative value on failure."]
    pub fn tsk_site_table_add_row(
        self_: *mut tsk_site_table_t,
        position: f64,
        ancestral_state: *const ::std::os::raw::c_char,
        ancestral_state_length: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``ancestral_state`` and ``metadata`` parameters are taken\nimmediately. See the :ref:`table definition <sec_site_table_definition>` for\ndetails of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param index The row to update.\n@param position The position coordinate for the site.\n@param ancestral_state The ancestral_state for the site.\n@param ancestral_state_length The length of the ancestral_state in bytes.\n@param metadata The metadata to be associated with the site. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_update_row(
        self_: *mut tsk_site_table_t,
        index: tsk_id_t,
        position: f64,
        ancestral_state: *const ::std::os::raw::c_char,
        ancestral_state_length: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_site_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_clear(self_: *mut tsk_site_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_site_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_truncate(
        self_: *mut tsk_site_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object where rows are to be added.\n@param other A pointer to a tsk_site_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_extend(
        self_: *mut tsk_site_table_t,
        other: *const tsk_site_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param other A pointer to a tsk_site_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_site_table_equals(
        self_: *const tsk_site_table_t,
        other: *const tsk_site_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param dest A pointer to a tsk_site_table_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised site table. If not, it must\nbe an uninitialised site table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_copy(
        self_: *const tsk_site_table_t,
        dest: *mut tsk_site_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified site struct to reflect the values in the specified row.\n\nThis function always sets the ``mutations`` and ``mutations_length``\nfields in the parameter :c:struct:`tsk_site_t` to ``NULL`` and ``0`` respectively.\nTo get access to the mutations for a particular site, please use the\ntree sequence method, :c:func:`tsk_treeseq_get_site`.\n\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_site_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_get_row(
        self_: *const tsk_site_table_t,
        index: tsk_id_t,
        row: *mut tsk_site_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_site_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_set_metadata_schema(
        self_: *mut tsk_site_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_site_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_site_table_print_state(self_: *const tsk_site_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param position The array of double position values to be copied.\n@param ancestral_state The array of char ancestral state values to be copied.\n@param ancestral_state_offset The array of tsk_size_t ancestral state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_set_columns(
        self_: *mut tsk_site_table_t,
        num_rows: tsk_size_t,
        position: *const f64,
        ancestral_state: *const ::std::os::raw::c_char,
        ancestral_state_offset: *const tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param position The array of double position values to be copied.\n@param ancestral_state The array of char ancestral state values to be copied.\n@param ancestral_state_offset The array of tsk_size_t ancestral state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_append_columns(
        self_: *mut tsk_site_table_t,
        num_rows: tsk_size_t,
        position: *const f64,
        ancestral_state: *const ::std::os::raw::c_char,
        ancestral_state_offset: *const tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_set_max_rows_increment(
        self_: *mut tsk_site_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_set_max_metadata_length_increment(
        self_: *mut tsk_site_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the ancestral_state column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_site_table_t object.\n@param max_ancestral_state_length_increment The number of bytes to pre-allocate, or zero\nfor the default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_site_table_set_max_ancestral_state_length_increment(
        self_: *mut tsk_site_table_t,
        max_ancestral_state_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_site_table_dump_text(
        self_: *const tsk_site_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_mutation_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_init(
        self_: *mut tsk_mutation_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_mutation_table_t object.\n@return Always returns 0."]
    pub fn tsk_mutation_table_free(self_: *mut tsk_mutation_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this mutation table.\n\n@rst\nAdd a new mutation with the specified ``site``, ``parent``, ``derived_state``\nand ``metadata`` to the table. Copies of ``derived_state`` and ``metadata``\nare immediately taken. See the :ref:`table definition <sec_mutation_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param site The site ID for the new mutation.\n@param node The ID of the node this mutation occurs over.\n@param parent The ID of the parent mutation.\n@param time The time of the mutation.\n@param derived_state The derived_state for the new mutation.\n@param derived_state_length The length of the derived_state in bytes.\n@param metadata The metadata to be associated with the new mutation. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added mutation on success,\nor a negative value on failure."]
    pub fn tsk_mutation_table_add_row(
        self_: *mut tsk_mutation_table_t,
        site: tsk_id_t,
        node: tsk_id_t,
        parent: tsk_id_t,
        time: f64,
        derived_state: *const ::std::os::raw::c_char,
        derived_state_length: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``derived_state`` and ``metadata`` parameters are taken\nimmediately. See the :ref:`table definition <sec_mutation_table_definition>` for\ndetails of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param index The row to update.\n@param site The site ID for the mutation.\n@param node The ID of the node this mutation occurs over.\n@param parent The ID of the parent mutation.\n@param time The time of the mutation.\n@param derived_state The derived_state for the mutation.\n@param derived_state_length The length of the derived_state in bytes.\n@param metadata The metadata to be associated with the mutation. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_update_row(
        self_: *mut tsk_mutation_table_t,
        index: tsk_id_t,
        site: tsk_id_t,
        node: tsk_id_t,
        parent: tsk_id_t,
        time: f64,
        derived_state: *const ::std::os::raw::c_char,
        derived_state_length: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_mutation_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_clear(self_: *mut tsk_mutation_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_truncate(
        self_: *mut tsk_mutation_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object where rows are to be added.\n@param other A pointer to a tsk_mutation_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_extend(
        self_: *mut tsk_mutation_table_t,
        other: *const tsk_mutation_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param other A pointer to a tsk_mutation_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_mutation_table_equals(
        self_: *const tsk_mutation_table_t,
        other: *const tsk_mutation_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param dest A pointer to a tsk_mutation_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised mutation table. If not, it must be an\nuninitialised mutation table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_copy(
        self_: *const tsk_mutation_table_t,
        dest: *mut tsk_mutation_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified mutation struct to reflect the values in the specified row.\n\nThis function always sets the ``edge`` field in parameter\n:c:struct:`tsk_mutation_t` to ``TSK_NULL``. To determine the ID of\nthe edge associated with a particular mutation, please use the\ntree sequence method, :c:func:`tsk_treeseq_get_mutation`.\n\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_mutation_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_get_row(
        self_: *const tsk_mutation_table_t,
        index: tsk_id_t,
        row: *mut tsk_mutation_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_mutation_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_set_metadata_schema(
        self_: *mut tsk_mutation_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_mutation_table_print_state(self_: *const tsk_mutation_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param site The array of tsk_id_t site values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param time The array of double time values to be copied.\n@param derived_state The array of char derived_state values to be copied.\n@param derived_state_offset The array of tsk_size_t derived state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_set_columns(
        self_: *mut tsk_mutation_table_t,
        num_rows: tsk_size_t,
        site: *const tsk_id_t,
        node: *const tsk_id_t,
        parent: *const tsk_id_t,
        time: *const f64,
        derived_state: *const ::std::os::raw::c_char,
        derived_state_offset: *const tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param site The array of tsk_id_t site values to be copied.\n@param node The array of tsk_id_t node values to be copied.\n@param parent The array of tsk_id_t parent values to be copied.\n@param time The array of double time values to be copied.\n@param derived_state The array of char derived_state values to be copied.\n@param derived_state_offset The array of tsk_size_t derived state offset values to be\ncopied.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_append_columns(
        self_: *mut tsk_mutation_table_t,
        num_rows: tsk_size_t,
        site: *const tsk_id_t,
        node: *const tsk_id_t,
        parent: *const tsk_id_t,
        time: *const f64,
        derived_state: *const ::std::os::raw::c_char,
        derived_state_offset: *const tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_set_max_rows_increment(
        self_: *mut tsk_mutation_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_set_max_metadata_length_increment(
        self_: *mut tsk_mutation_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the derived_state column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_mutation_table_t object.\n@param max_derived_state_length_increment The number of bytes to pre-allocate, or zero\nfor the default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_mutation_table_set_max_derived_state_length_increment(
        self_: *mut tsk_mutation_table_t,
        max_derived_state_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_mutation_table_dump_text(
        self_: *const tsk_mutation_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_population_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_init(
        self_: *mut tsk_population_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_population_table_t object.\n@return Always returns 0."]
    pub fn tsk_population_table_free(self_: *mut tsk_population_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this population table.\n\n@rst\nAdd a new population with the specified ``metadata`` to the table. A copy of the\n``metadata`` is immediately taken. See the :ref:`table definition\n<sec_population_table_definition>` for details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param metadata The metadata to be associated with the new population. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return the ID of the newly added population on success,\nor a negative value on failure."]
    pub fn tsk_population_table_add_row(
        self_: *mut tsk_population_table_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. A copy of the ``metadata`` parameter is taken immediately. See the\n:ref:`table definition <sec_population_table_definition>` for details of the\ncolumns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param index The row to update.\n@param metadata The metadata to be associated with the population. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``metadata_length`` is 0.\n@param metadata_length The size of the metadata array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_update_row(
        self_: *mut tsk_population_table_t,
        index: tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_population_table_free` to free the table's internal resources. Note that the\nmetadata schema is not cleared.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_clear(self_: *mut tsk_population_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_population_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_truncate(
        self_: *mut tsk_population_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table. Note that metadata is copied as-is\nand is not checked for compatibility with any existing schema on this table.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object where rows are to be added.\n@param other A pointer to a tsk_population_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_extend(
        self_: *mut tsk_population_table_t,
        other: *const tsk_population_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns,\nand their metadata schemas are byte-wise identical.\n\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\nDo not include metadata in the comparison. Note that as metadata is the\nonly column in the population table, two population tables are considered\nequal if they have the same number of rows if this flag is specified.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param other A pointer to a tsk_population_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_population_table_equals(
        self_: *const tsk_population_table_t,
        other: *const tsk_population_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param dest A pointer to a tsk_population_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised population table. If not, it must be an\nuninitialised population table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_copy(
        self_: *const tsk_population_table_t,
        dest: *mut tsk_population_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified population struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_population_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_get_row(
        self_: *const tsk_population_table_t,
        index: tsk_id_t,
        row: *mut tsk_population_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table, replacing any existing.\n@endrst\n@param self A pointer to a tsk_population_table_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_set_metadata_schema(
        self_: *mut tsk_population_table_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_population_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_population_table_print_state(self_: *const tsk_population_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_set_columns(
        self_: *mut tsk_population_table_t,
        num_rows: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param metadata The array of char metadata values to be copied.\n@param metadata_offset The array of tsk_size_t metadata offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_append_columns(
        self_: *mut tsk_population_table_t,
        num_rows: tsk_size_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_set_max_rows_increment(
        self_: *mut tsk_population_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the metadata column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_population_table_t object.\n@param max_metadata_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_population_table_set_max_metadata_length_increment(
        self_: *mut tsk_population_table_t,
        max_metadata_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_population_table_dump_text(
        self_: *const tsk_population_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table by allocating the internal memory.\n\n@rst\nThis must be called before any operations are performed on the table.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_provenance_table_t object.\n@param options Allocation time options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_init(
        self_: *mut tsk_provenance_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table.\n\n@param self A pointer to an initialised tsk_provenance_table_t object.\n@return Always returns 0."]
    pub fn tsk_provenance_table_free(self_: *mut tsk_provenance_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Adds a row to this provenance table.\n\n@rst\nAdd a new provenance with the specified ``timestamp`` and ``record`` to the table.\nCopies of the ``timestamp`` and ``record`` are immediately taken.\nSee the :ref:`table definition <sec_provenance_table_definition>`\nfor details of the columns in this table.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param timestamp The timestamp to be associated with the new provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``timestamp_length`` is 0.\n@param timestamp_length The size of the timestamp array in bytes.\n@param record The record to be associated with the new provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``record_length`` is 0.\n@param record_length The size of the record array in bytes.\n@return Return the ID of the newly added provenance on success,\nor a negative value on failure."]
    pub fn tsk_provenance_table_add_row(
        self_: *mut tsk_provenance_table_t,
        timestamp: *const ::std::os::raw::c_char,
        timestamp_length: tsk_size_t,
        record: *const ::std::os::raw::c_char,
        record_length: tsk_size_t,
    ) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Updates the row at the specified index.\n\n@rst\nRewrite the row at the specified index in this table to use the specified\nvalues. Copies of the ``timestamp`` and ``record`` parameters are taken\nimmediately. See the :ref:`table definition <sec_provenance_table_definition>`\nfor details of the columns in this table.\n\n.. warning::\nBecause of the way that ragged columns are encoded, this method requires a\nfull rewrite of the internal column memory in worst case, and would\ntherefore be inefficient for bulk updates for such columns. However, if the\nsizes of all ragged column values are unchanged in the updated row, this\nmethod is guaranteed to only update the memory for the row in question.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param index The row to update.\n@param timestamp The timestamp to be associated with new provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``timestamp_length`` is 0.\n@param timestamp_length The size of the timestamp array in bytes.\n@param record The record to be associated with the provenance. This\nis a pointer to arbitrary memory. Can be ``NULL`` if ``record_length`` is 0.\n@param record_length The size of the record array in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_update_row(
        self_: *mut tsk_provenance_table_t,
        index: tsk_id_t,
        timestamp: *const ::std::os::raw::c_char,
        timestamp_length: tsk_size_t,
        record: *const ::std::os::raw::c_char,
        record_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears this table, setting the number of rows to zero.\n\n@rst\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_provenance_table_free` to free the table's internal resources.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_clear(self_: *mut tsk_provenance_table_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates this table so that only the first num_rows are retained.\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param num_rows The number of rows to retain in the table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_truncate(
        self_: *mut tsk_provenance_table_t,
        num_rows: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by appending rows copied from another table.\n\n@rst\nAppends the rows at the specified indexes from the table ``other`` to the end of this\ntable. Row indexes can be repeated and in any order. If ``row_indexes`` is NULL, append\nthe first ``num_rows`` from ``other`` to this table.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object where rows are to be added.\n@param other A pointer to a tsk_provenance_table_t object where rows are copied from.\n@param num_rows The number of rows from ``other`` to append to this table.\n@param row_indexes Array of row indexes in ``other``. If ``NULL`` is passed then the\nfirst ``num_rows`` of ``other`` are used.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_extend(
        self_: *mut tsk_provenance_table_t,
        other: *const tsk_provenance_table_t,
        num_rows: tsk_size_t,
        row_indexes: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table is identical to the data\nin this table.\n\n@rst\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) tables are\nconsidered equal if they are byte-wise identical in all columns.\n\n- :c:macro:`TSK_CMP_IGNORE_TIMESTAMPS`\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param other A pointer to a tsk_provenance_table_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table is equal to this table."]
    pub fn tsk_provenance_table_equals(
        self_: *const tsk_provenance_table_t,
        other: *const tsk_provenance_table_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param dest A pointer to a tsk_provenance_table_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised provenance table. If not, it must be an\nuninitialised provenance table.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_copy(
        self_: *const tsk_provenance_table_t,
        dest: *mut tsk_provenance_table_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get the row at the specified index.\n\n@rst\nUpdates the specified provenance struct to reflect the values in the specified row.\nPointers to memory within this struct are handled by the table and should **not**\nbe freed by client code. These pointers are guaranteed to be valid until the\nnext operation that modifies the table (e.g., by adding a new row), but not afterwards.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param index The requested table row.\n@param row A pointer to a tsk_provenance_t struct that is updated to reflect the\nvalues in the specified row.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_get_row(
        self_: *const tsk_provenance_table_t,
        index: tsk_id_t,
        row: *mut tsk_provenance_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_provenance_table_print_state(self_: *const tsk_provenance_table_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Replace this table's data by copying from a set of column arrays\n\n@rst\nClears the data columns of this table and then copies column data from the specified\nset of arrays. The supplied arrays should all contain data on the same number of rows.\nThe metadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param timestamp The array of char timestamp values to be copied.\n@param timestamp_offset The array of tsk_size_t timestamp offset values to be copied.\n@param record The array of char record values to be copied.\n@param record_offset The array of tsk_size_t record offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_set_columns(
        self_: *mut tsk_provenance_table_t,
        num_rows: tsk_size_t,
        timestamp: *const ::std::os::raw::c_char,
        timestamp_offset: *const tsk_size_t,
        record: *const ::std::os::raw::c_char,
        record_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Extends this table by copying from a set of column arrays\n\n@rst\nCopies column data from the specified set of arrays to create new rows at the end of the\ntable. The supplied arrays should all contain data on the same number of rows. The\nmetadata schema is not affected.\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param num_rows The number of rows to copy from the specifed arrays.\n@param timestamp The array of char timestamp values to be copied.\n@param timestamp_offset The array of tsk_size_t timestamp offset values to be copied.\n@param record The array of char record values to be copied.\n@param record_offset The array of tsk_size_t record offset values to be copied.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_append_columns(
        self_: *mut tsk_provenance_table_t,
        num_rows: tsk_size_t,
        timestamp: *const ::std::os::raw::c_char,
        timestamp_offset: *const tsk_size_t,
        record: *const ::std::os::raw::c_char,
        record_offset: *const tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for this table\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param max_rows_increment The number of rows to pre-allocate, or zero for the default\ndoubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_set_max_rows_increment(
        self_: *mut tsk_provenance_table_t,
        max_rows_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the timestamp column\n\n@rst\nSet a fixed pre-allocation size, or use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param max_timestamp_length_increment The number of bytes to pre-allocate, or zero for\nthe default doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_set_max_timestamp_length_increment(
        self_: *mut tsk_provenance_table_t,
        max_timestamp_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Controls the pre-allocation strategy for the record column\n\n@rst\nSet a fixed pre-allocation size, use the default doubling strategy.\nSee :ref:`sec_c_api_memory_allocation_strategy` for details on the default\npre-allocation strategy,\n@endrst\n\n@param self A pointer to a tsk_provenance_table_t object.\n@param max_record_length_increment The number of bytes to pre-allocate, or zero for the\ndefault doubling strategy.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_provenance_table_set_max_record_length_increment(
        self_: *mut tsk_provenance_table_t,
        max_record_length_increment: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_provenance_table_dump_text(
        self_: *const tsk_provenance_table_t,
        out: *mut FILE,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the table collection by allocating the internal memory\nand initialising all the constituent tables.\n\n@rst\nThis must be called before any operations are performed on the table\ncollection. See the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nOptions**\n\nOptions can be specified by providing bitwise flags:\n\n- :c:macro:`TSK_TC_NO_EDGE_METADATA`\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object.\n@param options Allocation time options as above.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_init(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table collection.\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@return Always returns 0."]
    pub fn tsk_table_collection_free(self_: *mut tsk_table_collection_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Clears data tables (and optionally provenances and metadata) in\nthis table collection.\n\n@rst\nBy default this operation clears all tables except the provenance table, retaining\ntable metadata schemas and the tree-sequence level metadata and schema.\n\nNo memory is freed as a result of this operation; please use\n:c:func:`tsk_table_collection_free` to free internal resources.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_CLEAR_PROVENANCE`\n- :c:macro:`TSK_CLEAR_METADATA_SCHEMAS`\n- :c:macro:`TSK_CLEAR_TS_METADATA_AND_SCHEMA`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise clearing options.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_clear(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if the data in the specified table collection is equal\nto the data in this table collection.\n\n@rst\n\nReturns true if the two table collections are equal. The indexes are\nnot considered as these are derived from the tables. We also do not\nconsider the ``file_uuid``, since it is a property of the file that set\nof tables is stored in.\n\nOptions**\n\nOptions to control the comparison can be specified by providing one or\nmore of the following bitwise flags. By default (options=0) two table\ncollections are considered equal if all of the tables are byte-wise\nidentical, and the sequence lengths, metadata and metadata schemas\nof the two table collections are identical.\n\n- :c:macro:`TSK_CMP_IGNORE_PROVENANCE`\n- :c:macro:`TSK_CMP_IGNORE_METADATA`\n- :c:macro:`TSK_CMP_IGNORE_TS_METADATA`\n- :c:macro:`TSK_CMP_IGNORE_TIMESTAMPS`\n- :c:macro:`TSK_CMP_IGNORE_TABLES`\n- :c:macro:`TSK_CMP_IGNORE_REFERENCE_SEQUENCE`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param other A pointer to a tsk_table_collection_t object.\n@param options Bitwise comparison options.\n@return Return true if the specified table collection is equal to this table."]
    pub fn tsk_table_collection_equals(
        self_: *const tsk_table_collection_t,
        other: *const tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Copies the state of this table collection into the specified destination.\n\n@rst\nBy default the method initialises the specified destination table collection. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n\nOptions**\n\nOptions can be specified by providing bitwise flags:\n\n:c:macro:`TSK_COPY_FILE_UUID`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param dest A pointer to a tsk_table_collection_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised table collection. If not, it must be an\nuninitialised table collection.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_copy(
        self_: *const tsk_table_collection_t,
        dest: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this table collection to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_table_collection_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_table_collection_print_state(self_: *const tsk_table_collection_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Load a table collection from a file path.\n\n@rst\nLoads the data from the specified file into this table collection.\nBy default, the table collection is also initialised.\nThe resources allocated must be freed using\n:c:func:`tsk_table_collection_free` even in error conditions.\n\nIf the :c:macro:`TSK_NO_INIT` option is set, the table collection is\nnot initialised, allowing an already initialised table collection to\nbe overwritten with the data from a file.\n\nIf the file contains multiple table collections, this function will load\nthe first. Please see the :c:func:`tsk_table_collection_loadf` for details\non how to sequentially load table collections from a stream.\n\nIf the :c:macro:`TSK_LOAD_SKIP_TABLES` option is set, only the non-table information from\nthe table collection will be read, leaving all tables with zero rows and no\nmetadata or schema.\nIf the :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE` option is set, the table collection is\nread without loading the reference sequence.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_NO_INIT`\n- :c:macro:`TSK_LOAD_SKIP_TABLES`\n- :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE`\n\nExamples**\n\n.. code-block:: c\n\nint ret;\ntsk_table_collection_t tables;\nret = tsk_table_collection_load(&tables, \"data.trees\", 0);\nif (ret != 0) {\nfprintf(stderr, \"Load error:%s\\n\", tsk_strerror(ret));\nexit(EXIT_FAILURE);\n}\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object\nif the TSK_NO_INIT option is not set (default), or an initialised\ntsk_table_collection_t otherwise.\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_load(
        self_: *mut tsk_table_collection_t,
        filename: *const ::std::os::raw::c_char,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Load a table collection from a stream.\n\n@rst\nLoads a tables definition from the specified file stream to this table\ncollection. By default, the table collection is also initialised.\nThe resources allocated must be freed using\n:c:func:`tsk_table_collection_free` even in error conditions.\n\nIf the :c:macro:`TSK_NO_INIT` option is set, the table collection is\nnot initialised, allowing an already initialised table collection to\nbe overwritten with the data from a file.\n\nThe stream can be an arbitrary file descriptor, for example a network socket.\nNo seek operations are performed.\n\nIf the stream contains multiple table collection definitions, this function\nwill load the next table collection from the stream. If the stream contains no\nmore table collection definitions the error value :c:macro:`TSK_ERR_EOF` will\nbe returned. Note that EOF is only returned in the case where zero bytes are\nread from the stream --- malformed files or other errors will result in\ndifferent error conditions. Please see the\n:ref:`sec_c_api_examples_file_streaming` section for an example of how to\nsequentially load tree sequences from a stream.\n\nPlease note that this streaming behaviour is not supported if the\n:c:macro:`TSK_LOAD_SKIP_TABLES` or :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE` option is\nset. If the :c:macro:`TSK_LOAD_SKIP_TABLES` option is set, only the non-table information\nfrom the table collection will be read, leaving all tables with zero rows and no metadata\nor schema. If the :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE` option is set, the table\ncollection is read without loading the reference sequence. When attempting to read from a\nstream with multiple table collection definitions and either of these two options set,\nthe requested information from the first table collection will be read on the first call\nto :c:func:`tsk_table_collection_loadf`, with subsequent calls leading to errors.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_NO_INIT`\n- :c:macro:`TSK_LOAD_SKIP_TABLES`\n- :c:macro:`TSK_LOAD_SKIP_REFERENCE_SEQUENCE`\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object\nif the TSK_NO_INIT option is not set (default), or an initialised\ntsk_table_collection_t otherwise.\n@param file A FILE stream opened in an appropriate mode for reading (e.g.\n\"r\", \"r+\" or \"w+\") positioned at the beginning of a table collection\ndefinition.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_loadf(
        self_: *mut tsk_table_collection_t,
        file: *mut FILE,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Write a table collection to file.\n\n@rst\nWrites the data from this table collection to the specified file.\n\nIf an error occurs the file path is deleted, ensuring that only complete\nand well formed files will be written.\n\nExamples**\n\n.. code-block:: c\n\nint ret;\ntsk_table_collection_t tables;\n\nret = tsk_table_collection_init(&tables, 0);\nerror_check(ret);\ntables.sequence_length = 1.0;\n// Write out the empty tree sequence\nret = tsk_table_collection_dump(&tables, \"empty.trees\", 0);\nerror_check(ret);\n\n@endrst\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_dump(
        self_: *const tsk_table_collection_t,
        filename: *const ::std::os::raw::c_char,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Write a table collection to a stream.\n\n@rst\nWrites the data from this table collection to the specified FILE stream.\nSemantics are identical to :c:func:`tsk_table_collection_dump`.\n\nPlease see the :ref:`sec_c_api_examples_file_streaming` section for an example\nof how to sequentially dump and load tree sequences from a stream.\n\n@endrst\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@param file A FILE stream opened in an appropriate mode for writing (e.g.\n\"w\", \"a\", \"r+\" or \"w+\").\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_dumpf(
        self_: *const tsk_table_collection_t,
        file: *mut FILE,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Record the number of rows in each table in the specified tsk_bookmark_t object.\n\n@param self A pointer to an initialised tsk_table_collection_t object.\n@param bookmark A pointer to a tsk_bookmark_t which is updated to contain the number of\nrows in all tables.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_record_num_rows(
        self_: *const tsk_table_collection_t,
        bookmark: *mut tsk_bookmark_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Truncates the tables in this table collection according to the specified bookmark.\n\n@rst\nTruncate the tables in this collection so that each one has the number\nof rows specified in the parameter :c:type:`tsk_bookmark_t`. Use the\n:c:func:`tsk_table_collection_record_num_rows` function to record the\nnumber rows for each table in a table collection at a particular time.\n@endrst\n\n@param self A pointer to a tsk_individual_table_t object.\n@param bookmark The number of rows to retain in each table.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_truncate(
        self_: *mut tsk_table_collection_t,
        bookmark: *mut tsk_bookmark_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Sorts the tables in this collection.\n\n@rst\nSome of the tables in a table collection must satisfy specific sortedness requirements\nin order to define a :ref:`valid tree sequence <sec_valid_tree_sequence_requirements>`.\nThis method sorts the ``edge``, ``site``, ``mutation`` and ``individual`` tables such\nthat these requirements are guaranteed to be fulfilled. The ``node``, ``population``\nand ``provenance`` tables do not have any sortedness requirements, and are therefore\nignored by this method.\n\n.. note:: The current implementation **may** sort in such a way that exceeds\nthese requirements, but this behaviour should not be relied upon and later\nversions may weaken the level of sortedness. However, the method does **guarantee**\nthat the resulting tables describes a valid tree sequence.\n\n.. warning:: Sorting migrations is currently not supported and an error will be raised\nif a table collection containing a non-empty migration table is specified.\n\nThe specified :c:type:`tsk_bookmark_t` allows us to specify a start position\nfor sorting in each of the tables; rows before this value are assumed to already be\nin sorted order and this information is used to make sorting more efficient.\nPositions in tables that are not sorted (``node``, ``population``\nand ``provenance``) are ignored and can be set to arbitrary values.\n\n.. warning:: The current implementation only supports specifying a start\nposition for the ``edge`` table and in a limited form for the\n``site``, ``mutation`` and ``individual`` tables. Specifying a non-zero\n``migration``, start position results in an error. The start positions for the\n``site``, ``mutation`` and ``individual`` tables can either be 0 or the length of the\nrespective tables, allowing these tables to either be fully sorted, or not sorted at\nall.\n\nThe table collection will always be unindexed after sort successfully completes.\n\nFor more control over the sorting process, see the :ref:`sec_c_api_low_level_sorting`\nsection.\n\nOptions**\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n:c:macro:`TSK_NO_CHECK_INTEGRITY`\nDo not run integrity checks using\n:c:func:`tsk_table_collection_check_integrity` before sorting,\npotentially leading to a small reduction in execution time. This\nperformance optimisation should not be used unless the calling code can\nguarantee reference integrity within the table collection. References\nto rows not in the table or bad offsets will result in undefined\nbehaviour.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param start The position to begin sorting in each table; all rows less than this\nposition must fulfill the tree sequence sortedness requirements. If this is\nNULL, sort all rows.\n@param options Sort options.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_sort(
        self_: *mut tsk_table_collection_t,
        start: *const tsk_bookmark_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Sorts the individual table in this collection.\n\n@rst\nSorts the individual table in place, so that parents come before children,\nand the parent column is remapped as required. Node references to individuals\nare also updated.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Sort options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_individual_topological_sort(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Puts the tables into canonical form.\n\n@rst\nPut tables into canonical form such that randomly reshuffled tables\nare guaranteed to always be sorted in the same order, and redundant\ninformation is removed. The canonical sorting exceeds the usual\ntree sequence sortedness requirements.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_SUBSET_KEEP_UNREFERENCED`\n\n@endrst\n\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_canonicalise(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Simplify the tables to remove redundant information.\n\n@rst\nSimplification transforms the tables to remove redundancy and canonicalise\ntree sequence data. See the :ref:`simplification <sec_simplification>` tutorial for\nmore details.\n\nA mapping from the node IDs in the table before simplification to their equivalent\nvalues after simplification can be obtained via the ``node_map`` argument. If this\nis non NULL, ``node_map[u]`` will contain the new ID for node ``u`` after simplification,\nor :c:macro:`TSK_NULL` if the node has been removed. Thus, ``node_map`` must be an array\nof at least ``self->nodes.num_rows`` :c:type:`tsk_id_t` values. The table collection will\nalways be unindexed after simplify successfully completes.\n\n.. note:: Migrations are currently not supported by simplify, and an error will\nbe raised if we attempt call simplify on a table collection with greater\nthan zero migrations. See `<https://github.com/tskit-dev/tskit/issues/20>`_\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_SIMPLIFY_FILTER_SITES`\n- :c:macro:`TSK_SIMPLIFY_FILTER_POPULATIONS`\n- :c:macro:`TSK_SIMPLIFY_FILTER_INDIVIDUALS`\n- :c:macro:`TSK_SIMPLIFY_REDUCE_TO_SITE_TOPOLOGY`\n- :c:macro:`TSK_SIMPLIFY_KEEP_UNARY`\n- :c:macro:`TSK_SIMPLIFY_KEEP_INPUT_ROOTS`\n- :c:macro:`TSK_SIMPLIFY_KEEP_UNARY_IN_INDIVIDUALS`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param samples Either NULL or an array of num_samples distinct and valid node IDs.\nIf non-null the nodes in this array will be marked as samples in the output.\nIf NULL, the num_samples parameter is ignored and the samples in the output\nwill be the same as the samples in the input. This is equivalent to populating\nthe samples array with all of the sample nodes in the input in increasing\norder of ID.\n@param num_samples The number of node IDs in the input samples array. Ignored\nif the samples array is NULL.\n@param options Simplify options; see above for the available bitwise flags.\nFor the default behaviour, a value of 0 should be provided.\n@param node_map If not NULL, this array will be filled to define the mapping\nbetween nodes IDs in the table collection before and after simplification.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_simplify(
        self_: *mut tsk_table_collection_t,
        samples: *const tsk_id_t,
        num_samples: tsk_size_t,
        options: tsk_flags_t,
        node_map: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Subsets and reorders a table collection according to an array of nodes.\n\n@rst\nReduces the table collection to contain only the entries referring to\nthe provided list of nodes, with nodes reordered according to the order\nthey appear in the ``nodes`` argument. Specifically, this subsets and reorders\neach of the tables as follows (but see options, below):\n\n1. Nodes: if in the list of nodes, and in the order provided.\n2. Individuals: if referred to by a retained node.\n3. Populations: if referred to by a retained node, and in the order first seen\nwhen traversing the list of retained nodes.\n4. Edges: if both parent and child are retained nodes.\n5. Mutations: if the mutation's node is a retained node.\n6. Sites: if any mutations remain at the site after removing mutations.\n\nRetained individuals, edges, mutations, and sites appear in the same\norder as in the original tables. Note that only the information *directly*\nassociated with the provided nodes is retained - for instance,\nsubsetting to nodes=[A, B] does not retain nodes ancestral to A and B,\nand only retains the individuals A and B are in, and not their parents.\n\nThis function does *not* require the tables to be sorted.\n\n.. note:: Migrations are currently not supported by subset, and an error will\nbe raised if we attempt call subset on a table collection with greater\nthan zero migrations.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_SUBSET_NO_CHANGE_POPULATIONS`\n- :c:macro:`TSK_SUBSET_KEEP_UNREFERENCED`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param nodes An array of num_nodes valid node IDs.\n@param num_nodes The number of node IDs in the input nodes array.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_subset(
        self_: *mut tsk_table_collection_t,
        nodes: *const tsk_id_t,
        num_nodes: tsk_size_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Forms the node-wise union of two table collections.\n\n@rst\nExpands this table collection by adding the non-shared portions of another table\ncollection to itself. The ``other_node_mapping`` encodes which nodes in ``other`` are\nequivalent to a node in ``self``. The positions in the ``other_node_mapping`` array\ncorrespond to node ids in ``other``, and the elements encode the equivalent\nnode id in ``self`` or :c:macro:`TSK_NULL` if the node is exclusive to ``other``. Nodes\nthat are exclusive ``other`` are added to ``self``, along with:\n\n1. Individuals which are new to ``self``.\n2. Edges whose parent or child are new to ``self``.\n3. Sites which were not present in ``self``.\n4. Mutations whose nodes are new to ``self``.\n\nBy default, populations of newly added nodes are assumed to be new populations,\nand added to the population table as well.\n\nThis operation will also sort the resulting tables, so the tables may change\neven if nothing new is added, if the original tables were not sorted.\n\n.. note:: Migrations are currently not supported by union, and an error will\nbe raised if we attempt call union on a table collection with migrations.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_UNION_NO_CHECK_SHARED`\n- :c:macro:`TSK_UNION_NO_ADD_POP`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param other A pointer to a tsk_table_collection_t object.\n@param other_node_mapping An array of node IDs that relate nodes in other to nodes in\nself: the k-th element of other_node_mapping should be the index of the equivalent\nnode in self, or TSK_NULL if the node is not present in self (in which case it\nwill be added to self).\n@param options Union options; see above for the available bitwise flags.\nFor the default behaviour, a value of 0 should be provided.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_union(
        self_: *mut tsk_table_collection_t,
        other: *const tsk_table_collection_t,
        other_node_mapping: *const tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the time_units\n@rst\nCopies the time_units string to this table collection, replacing any existing.\n@endrst\n@param self A pointer to a tsk_table_collection_t object.\n@param time_units A pointer to a char array.\n@param time_units_length The size of the time units string in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_set_time_units(
        self_: *mut tsk_table_collection_t,
        time_units: *const ::std::os::raw::c_char,
        time_units_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata\n@rst\nCopies the metadata string to this table collection, replacing any existing.\n@endrst\n@param self A pointer to a tsk_table_collection_t object.\n@param metadata A pointer to a char array.\n@param metadata_length The size of the metadata in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_set_metadata(
        self_: *mut tsk_table_collection_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the metadata schema\n@rst\nCopies the metadata schema string to this table collection, replacing any existing.\n@endrst\n@param self A pointer to a tsk_table_collection_t object.\n@param metadata_schema A pointer to a char array.\n@param metadata_schema_length The size of the metadata schema in bytes.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_set_metadata_schema(
        self_: *mut tsk_table_collection_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if this table collection is indexed.\n\n@rst\nThis method returns true if the table collection has an index\nfor the edge table. It guarantees that the index exists, and that\nit is for the same number of edges that are in the edge table. It\ndoes *not* guarantee that the index is valid (i.e., if the rows\nin the edge have been permuted in some way since the index was built).\n\nSee the :ref:`sec_c_api_table_indexes` section for details on the index\nlife-cycle.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return true if there is an index present for this table collection."]
    pub fn tsk_table_collection_has_index(
        self_: *const tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    #[doc = "@brief Deletes the indexes for this table collection.\n\n@rst\nUnconditionally drop the indexes that may be present for this table collection. It\nis not an error to call this method on an unindexed table collection.\nSee the :ref:`sec_c_api_table_indexes` section for details on the index\nlife-cycle.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Always returns 0."]
    pub fn tsk_table_collection_drop_index(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Builds indexes for this table collection.\n\n@rst\nBuilds the tree traversal :ref:`indexes <sec_table_indexes>` for this table\ncollection. Any existing index is first dropped using\n:c:func:`tsk_table_collection_drop_index`. See the\n:ref:`sec_c_api_table_indexes` section for details on the index life-cycle.\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_collection_build_index(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Runs integrity checks on this table collection.\n\n@rst\n\nChecks the integrity of this table collection. The default checks (i.e., with\noptions = 0) guarantee the integrity of memory and entity references within the\ntable collection. All positions along the genome are checked\nto see if they are finite values and within the required bounds. Time values\nare checked to see if they are finite or marked as unknown.\nConsistency of the direction of inheritance is also checked: whether\nparents are more recent than children, mutations are not more recent\nthan their nodes or their mutation parents, etcetera.\n\nTo check if a set of tables fulfills the :ref:`requirements\n<sec_valid_tree_sequence_requirements>` needed for a valid tree sequence, use\nthe :c:macro:`TSK_CHECK_TREES` option. When this method is called with\n:c:macro:`TSK_CHECK_TREES`, the number of trees in the tree sequence is returned. Thus,\nto check for errors client code should verify that the return value is less than zero.\nAll other options will return zero on success and a negative value on failure.\n\nMore fine-grained checks can be achieved using bitwise combinations of the\nother options.\n\nOptions**:\n\nOptions can be specified by providing one or more of the following bitwise\nflags:\n\n- :c:macro:`TSK_CHECK_EDGE_ORDERING`\n- :c:macro:`TSK_CHECK_SITE_ORDERING`\n- :c:macro:`TSK_CHECK_SITE_DUPLICATES`\n- :c:macro:`TSK_CHECK_MUTATION_ORDERING`\n- :c:macro:`TSK_CHECK_INDIVIDUAL_ORDERING`\n- :c:macro:`TSK_CHECK_MIGRATION_ORDERING`\n- :c:macro:`TSK_CHECK_INDEXES`\n- :c:macro:`TSK_CHECK_TREES`\n- :c:macro:`TSK_NO_CHECK_POPULATION_REFS`\n@endrst\n\n@param self A pointer to a tsk_table_collection_t object.\n@param options Bitwise options.\n@return Return a negative error value on if any problems are detected\nin the tree sequence. If the TSK_CHECK_TREES option is provided,\nthe number of trees in the tree sequence will be returned, on\nsuccess."]
    pub fn tsk_table_collection_check_integrity(
        self_: *const tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> tsk_id_t;
}
extern "C" {
    pub fn tsk_table_collection_ibd_within(
        self_: *const tsk_table_collection_t,
        result: *mut tsk_identity_segments_t,
        samples: *const tsk_id_t,
        num_samples: tsk_size_t,
        min_span: f64,
        max_time: f64,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_ibd_between(
        self_: *const tsk_table_collection_t,
        result: *mut tsk_identity_segments_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        min_span: f64,
        max_time: f64,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_link_ancestors(
        self_: *mut tsk_table_collection_t,
        samples: *mut tsk_id_t,
        num_samples: tsk_size_t,
        ancestors: *mut tsk_id_t,
        num_ancestors: tsk_size_t,
        options: tsk_flags_t,
        result: *mut tsk_edge_table_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_deduplicate_sites(
        tables: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_compute_mutation_parents(
        self_: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_compute_mutation_times(
        self_: *mut tsk_table_collection_t,
        random: *mut f64,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_delete_older(
        self_: *mut tsk_table_collection_t,
        time: f64,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_set_indexes(
        self_: *mut tsk_table_collection_t,
        edge_insertion_order: *mut tsk_id_t,
        edge_removal_order: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_takeset_metadata(
        self_: *mut tsk_table_collection_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_takeset_indexes(
        self_: *mut tsk_table_collection_t,
        edge_insertion_order: *mut tsk_id_t,
        edge_removal_order: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_individual_table_takeset_columns(
        self_: *mut tsk_individual_table_t,
        num_rows: tsk_size_t,
        flags: *mut tsk_flags_t,
        location: *mut f64,
        location_offset: *mut tsk_size_t,
        parents: *mut tsk_id_t,
        parents_offset: *mut tsk_size_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_node_table_takeset_columns(
        self_: *mut tsk_node_table_t,
        num_rows: tsk_size_t,
        flags: *mut tsk_flags_t,
        time: *mut f64,
        population: *mut tsk_id_t,
        individual: *mut tsk_id_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_edge_table_takeset_columns(
        self_: *mut tsk_edge_table_t,
        num_rows: tsk_size_t,
        left: *mut f64,
        right: *mut f64,
        parent: *mut tsk_id_t,
        child: *mut tsk_id_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_migration_table_takeset_columns(
        self_: *mut tsk_migration_table_t,
        num_rows: tsk_size_t,
        left: *mut f64,
        right: *mut f64,
        node: *mut tsk_id_t,
        source: *mut tsk_id_t,
        dest: *mut tsk_id_t,
        time: *mut f64,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_site_table_takeset_columns(
        self_: *mut tsk_site_table_t,
        num_rows: tsk_size_t,
        position: *mut f64,
        ancestral_state: *mut ::std::os::raw::c_char,
        ancestral_state_offset: *mut tsk_size_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_mutation_table_takeset_columns(
        self_: *mut tsk_mutation_table_t,
        num_rows: tsk_size_t,
        site: *mut tsk_id_t,
        node: *mut tsk_id_t,
        parent: *mut tsk_id_t,
        time: *mut f64,
        derived_state: *mut ::std::os::raw::c_char,
        derived_state_offset: *mut tsk_size_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_population_table_takeset_columns(
        self_: *mut tsk_population_table_t,
        num_rows: tsk_size_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_provenance_table_takeset_columns(
        self_: *mut tsk_provenance_table_t,
        num_rows: tsk_size_t,
        timestamp: *mut ::std::os::raw::c_char,
        timestamp_offset: *mut tsk_size_t,
        record: *mut ::std::os::raw::c_char,
        record_offset: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_table_collection_has_reference_sequence(
        self_: *const tsk_table_collection_t,
    ) -> bool;
}
extern "C" {
    pub fn tsk_reference_sequence_init(
        self_: *mut tsk_reference_sequence_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_free(
        self_: *mut tsk_reference_sequence_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_is_null(self_: *const tsk_reference_sequence_t) -> bool;
}
extern "C" {
    pub fn tsk_reference_sequence_equals(
        self_: *const tsk_reference_sequence_t,
        other: *const tsk_reference_sequence_t,
        options: tsk_flags_t,
    ) -> bool;
}
extern "C" {
    pub fn tsk_reference_sequence_copy(
        self_: *const tsk_reference_sequence_t,
        dest: *mut tsk_reference_sequence_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_set_data(
        self_: *mut tsk_reference_sequence_t,
        data: *const ::std::os::raw::c_char,
        data_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_set_url(
        self_: *mut tsk_reference_sequence_t,
        url: *const ::std::os::raw::c_char,
        url_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_set_metadata(
        self_: *mut tsk_reference_sequence_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_set_metadata_schema(
        self_: *mut tsk_reference_sequence_t,
        metadata_schema: *const ::std::os::raw::c_char,
        metadata_schema_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_takeset_data(
        self_: *mut tsk_reference_sequence_t,
        data: *mut ::std::os::raw::c_char,
        data_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_reference_sequence_takeset_metadata(
        self_: *mut tsk_reference_sequence_t,
        metadata: *mut ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the memory for the sorter object.\n\n@rst\nThis must be called before any operations are performed on the\ntable sorter and initialises all fields. The ``edge_sort`` function\nis set to the default method using qsort. The ``user_data``\nfield is set to NULL.\nThis method supports the same options as\n:c:func:`tsk_table_collection_sort`.\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_sorter_t object.\n@param tables The table collection to sort.\n@param options Sorting options.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_sorter_init(
        self_: *mut _tsk_table_sorter_t,
        tables: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Runs the sort using the configured functions.\n\n@rst\nRuns the sorting process:\n\n1. Drop the table indexes.\n2. If the ``sort_edges`` function pointer is not NULL, run it. The\nfirst parameter to the called function will be a pointer to this\ntable_sorter_t object. The second parameter will be the value\n``start.edges``. This specifies the offset at which sorting should\nstart in the edge table. This offset is guaranteed to be within the\nbounds of the edge table.\n3. Sort the site table, building the mapping between site IDs in the\ncurrent and sorted tables.\n4. Sort the mutation table, using the ``sort_mutations`` pointer.\n\nIf an error occurs during the execution of a user-supplied\nsorting function a non-zero value must be returned. This value\nwill then be returned by ``tsk_table_sorter_run``. The error\nreturn value should be chosen to avoid conflicts with tskit error\ncodes.\n\nSee :c:func:`tsk_table_collection_sort` for details on the ``start`` parameter.\n\n@endrst\n\n@param self A pointer to a tsk_table_sorter_t object.\n@param start The position in the tables at which sorting starts.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_table_sorter_run(
        self_: *mut _tsk_table_sorter_t,
        start: *const tsk_bookmark_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified table sorter.\n\n@param self A pointer to an initialised tsk_table_sorter_t object.\n@return Always returns 0."]
    pub fn tsk_table_sorter_free(self_: *mut _tsk_table_sorter_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_squash_edges(
        edges: *mut tsk_edge_t,
        num_edges: tsk_size_t,
        num_output_edges: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_identity_segments_get_num_segments(
        self_: *const tsk_identity_segments_t,
    ) -> tsk_size_t;
}
extern "C" {
    pub fn tsk_identity_segments_get_total_span(self_: *const tsk_identity_segments_t) -> f64;
}
extern "C" {
    pub fn tsk_identity_segments_get_num_pairs(self_: *const tsk_identity_segments_t)
        -> tsk_size_t;
}
extern "C" {
    pub fn tsk_identity_segments_get_keys(
        result: *const tsk_identity_segments_t,
        pairs: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_identity_segments_get_items(
        self_: *const tsk_identity_segments_t,
        pairs: *mut tsk_id_t,
        lists: *mut *mut tsk_identity_segment_list_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_identity_segments_get(
        self_: *const tsk_identity_segments_t,
        a: tsk_id_t,
        b: tsk_id_t,
        ret_list: *mut *mut tsk_identity_segment_list_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_identity_segments_print_state(self_: *mut tsk_identity_segments_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_identity_segments_free(self_: *mut tsk_identity_segments_t)
        -> ::std::os::raw::c_int;
}
#[doc = "@brief The tree sequence object."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_treeseq_t {
    pub num_trees: tsk_size_t,
    pub num_samples: tsk_size_t,
    pub samples: *mut tsk_id_t,
    pub time_uncalibrated: bool,
    pub discrete_genome: bool,
    pub discrete_time: bool,
    pub breakpoints: *mut f64,
    pub sample_index_map: *mut tsk_id_t,
    pub individual_nodes_mem: *mut tsk_id_t,
    pub individual_nodes: *mut *mut tsk_id_t,
    pub individual_nodes_length: *mut tsk_size_t,
    pub tree_sites_mem: *mut tsk_site_t,
    pub tree_sites: *mut *mut tsk_site_t,
    pub tree_sites_length: *mut tsk_size_t,
    pub site_mutations_mem: *mut tsk_mutation_t,
    pub site_mutations: *mut *mut tsk_mutation_t,
    pub site_mutations_length: *mut tsk_size_t,
    #[doc = " @brief  The table collection underlying this tree sequence, This table\n  collection must be treated as read-only, and any changes to it will\n  lead to undefined behaviour."]
    pub tables: *mut tsk_table_collection_t,
}
#[test]
fn bindgen_test_layout_tsk_treeseq_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_treeseq_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_treeseq_t>(),
        128usize,
        concat!("Size of: ", stringify!(tsk_treeseq_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_treeseq_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_treeseq_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_trees) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(num_trees)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(num_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).samples) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).time_uncalibrated) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(time_uncalibrated)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).discrete_genome) as usize - ptr as usize },
        25usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(discrete_genome)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).discrete_time) as usize - ptr as usize },
        26usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(discrete_time)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).breakpoints) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(breakpoints)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sample_index_map) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(sample_index_map)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individual_nodes_mem) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(individual_nodes_mem)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individual_nodes) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(individual_nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).individual_nodes_length) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(individual_nodes_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sites_mem) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(tree_sites_mem)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sites) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(tree_sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sites_length) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(tree_sites_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site_mutations_mem) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(site_mutations_mem)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site_mutations) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(site_mutations)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site_mutations_length) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(site_mutations_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tables) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_treeseq_t),
            "::",
            stringify!(tables)
        )
    );
}
#[doc = "@brief A single tree in a tree sequence.\n\n@rst\nA ``tsk_tree_t`` object has two basic functions:\n\n1. Represent the state of a single tree in a tree sequence;\n2. Provide methods to transform this state into different trees in the sequence.\n\nThe state of a single tree in the tree sequence is represented using the\nquintuply linked encoding: please see the\n:ref:`data model <sec_data_model_tree_structure>` section for details on\nhow this works. The left-to-right ordering of nodes in this encoding\nis arbitrary, and may change depending on the order in which trees are\naccessed within the sequence. Please see the\n:ref:`sec_c_api_examples_tree_traversals` examples for recommended\nusage.\n\nOn initialisation, a tree is in the :ref:`null state<sec_c_api_trees_null>` and\nwe must call one of the :ref:`seeking<sec_c_api_trees_seeking>` methods to make\nthe state of the tree object correspond to a particular tree in the sequence.\nPlease see the :ref:`sec_c_api_examples_tree_iteration` examples for\nrecommended usage.\n\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_tree_t {
    #[doc = " @brief The parent tree sequence."]
    pub tree_sequence: *const tsk_treeseq_t,
    #[doc = "@brief The ID of the \"virtual root\" whose children are the roots of the\ntree."]
    pub virtual_root: tsk_id_t,
    #[doc = "@brief The parent of node u is parent[u]. Equal to ``TSK_NULL`` if node u is\na root or is not a node in the current tree."]
    pub parent: *mut tsk_id_t,
    #[doc = "@brief The leftmost child of node u is left_child[u]. Equal to ``TSK_NULL``\nif node u is a leaf or is not a node in the current tree."]
    pub left_child: *mut tsk_id_t,
    #[doc = "@brief The rightmost child of node u is right_child[u]. Equal to ``TSK_NULL``\nif node u is a leaf or is not a node in the current tree."]
    pub right_child: *mut tsk_id_t,
    #[doc = "@brief The sibling to the left of node u is left_sib[u]. Equal to\n``TSK_NULL`` if node u has no siblings to its left."]
    pub left_sib: *mut tsk_id_t,
    #[doc = "@brief The sibling to the right of node u is right_sib[u]. Equal to\n``TSK_NULL`` if node u has no siblings to its right."]
    pub right_sib: *mut tsk_id_t,
    #[doc = "@brief The number of children of node u is num_children[u]."]
    pub num_children: *mut tsk_id_t,
    #[doc = "@brief Array of edge ids where ``edge[u]`` is the edge that encodes the\nrelationship between the child node ``u`` and its parent. Equal to\n``TSK_NULL`` if node ``u`` is a root, virtual root or is not a node in the\ncurrent tree."]
    pub edge: *mut tsk_id_t,
    #[doc = "@brief The total number of edges defining the topology of this tree.\nThis is equal to the number of tree sequence edges that intersect with\nthe tree's genomic interval."]
    pub num_edges: tsk_size_t,
    pub interval: tsk_tree_t__bindgen_ty_1,
    #[doc = "@brief The index of this tree in the tree sequence.\n\n@rst\nThis attribute provides the zero-based index of the tree represented by the\ncurrent state of the struct within the parent tree sequence. For example,\nimmediately after we call ``tsk_tree_first(&tree)``, ``tree.index`` will\nbe zero, and after we call ``tsk_tree_last(&tree)``, ``tree.index`` will\nbe the number of trees - 1 (see :c:func:`tsk_treeseq_get_num_trees`)\nWhen the tree is in the null state (immediately after initialisation,\nor after, e.g., calling :c:func:`tsk_tree_prev` on the first tree)\nthe value of the ``index`` is -1.\n@endrst"]
    pub index: tsk_id_t,
    pub num_nodes: tsk_size_t,
    pub options: tsk_flags_t,
    pub root_threshold: tsk_size_t,
    pub samples: *const tsk_id_t,
    pub num_samples: *mut tsk_size_t,
    pub num_tracked_samples: *mut tsk_size_t,
    pub left_sample: *mut tsk_id_t,
    pub right_sample: *mut tsk_id_t,
    pub next_sample: *mut tsk_id_t,
    pub sites: *const tsk_site_t,
    pub sites_length: tsk_size_t,
    pub direction: ::std::os::raw::c_int,
    pub left_index: tsk_id_t,
    pub right_index: tsk_id_t,
}
#[doc = "@brief Left and right coordinates of the genomic interval that this\ntree covers. The left coordinate is inclusive and the right coordinate\nexclusive.\n\n@rst\n\nExample:\n\n.. code-block:: c\n\ntsk_tree_t tree;\nint ret;\n// initialise etc\nret = tsk_tree_first(&tree);\n// Check for error\nassert(ret == TSK_TREE_OK);\nprintf(\"Coordinates covered by first tree are left=%f, right=%f\\n\",\ntree.interval.left, tree.interval.right);\n\n@endrst\n"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_tree_t__bindgen_ty_1 {
    pub left: f64,
    pub right: f64,
}
#[test]
fn bindgen_test_layout_tsk_tree_t__bindgen_ty_1() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_tree_t__bindgen_ty_1> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_tree_t__bindgen_ty_1>(),
        16usize,
        concat!("Size of: ", stringify!(tsk_tree_t__bindgen_ty_1))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_tree_t__bindgen_ty_1>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_tree_t__bindgen_ty_1))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t__bindgen_ty_1),
            "::",
            stringify!(left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t__bindgen_ty_1),
            "::",
            stringify!(right)
        )
    );
}
#[test]
fn bindgen_test_layout_tsk_tree_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_tree_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_tree_t>(),
        208usize,
        concat!("Size of: ", stringify!(tsk_tree_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_tree_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_tree_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).virtual_root) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(virtual_root)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left_child) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(left_child)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right_child) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(right_child)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left_sib) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(left_sib)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right_sib) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(right_sib)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_children) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(num_children)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edge) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(edge)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_edges) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(num_edges)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).interval) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(interval)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(num_nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
        112usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(options)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).root_threshold) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(root_threshold)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).samples) as usize - ptr as usize },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(num_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_tracked_samples) as usize - ptr as usize },
        144usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(num_tracked_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left_sample) as usize - ptr as usize },
        152usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(left_sample)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right_sample) as usize - ptr as usize },
        160usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(right_sample)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).next_sample) as usize - ptr as usize },
        168usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(next_sample)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sites) as usize - ptr as usize },
        176usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sites_length) as usize - ptr as usize },
        184usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(sites_length)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).direction) as usize - ptr as usize },
        192usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(direction)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).left_index) as usize - ptr as usize },
        196usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(left_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).right_index) as usize - ptr as usize },
        200usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_tree_t),
            "::",
            stringify!(right_index)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_edge_list_node_t {
    pub edge: tsk_edge_t,
    pub next: *mut _tsk_edge_list_node_t,
    pub prev: *mut _tsk_edge_list_node_t,
}
#[test]
fn bindgen_test_layout__tsk_edge_list_node_t() {
    const UNINIT: ::std::mem::MaybeUninit<_tsk_edge_list_node_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_tsk_edge_list_node_t>(),
        64usize,
        concat!("Size of: ", stringify!(_tsk_edge_list_node_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_tsk_edge_list_node_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_tsk_edge_list_node_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edge) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_edge_list_node_t),
            "::",
            stringify!(edge)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_edge_list_node_t),
            "::",
            stringify!(next)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).prev) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_edge_list_node_t),
            "::",
            stringify!(prev)
        )
    );
}
pub type tsk_edge_list_node_t = _tsk_edge_list_node_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_edge_list_t {
    pub head: *mut tsk_edge_list_node_t,
    pub tail: *mut tsk_edge_list_node_t,
}
#[test]
fn bindgen_test_layout_tsk_edge_list_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_edge_list_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_edge_list_t>(),
        16usize,
        concat!("Size of: ", stringify!(tsk_edge_list_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_edge_list_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_edge_list_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).head) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_list_t),
            "::",
            stringify!(head)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tail) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_edge_list_t),
            "::",
            stringify!(tail)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_diff_iter_t {
    pub num_nodes: tsk_size_t,
    pub num_edges: tsk_size_t,
    pub tree_left: f64,
    pub tree_sequence: *const tsk_treeseq_t,
    pub insertion_index: tsk_id_t,
    pub removal_index: tsk_id_t,
    pub tree_index: tsk_id_t,
    pub last_index: tsk_id_t,
    pub edge_list_nodes: *mut tsk_edge_list_node_t,
}
#[test]
fn bindgen_test_layout_tsk_diff_iter_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_diff_iter_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_diff_iter_t>(),
        56usize,
        concat!("Size of: ", stringify!(tsk_diff_iter_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_diff_iter_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_diff_iter_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(num_nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_edges) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(num_edges)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_left) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(tree_left)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).insertion_index) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(insertion_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).removal_index) as usize - ptr as usize },
        36usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(removal_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_index) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(tree_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).last_index) as usize - ptr as usize },
        44usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(last_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).edge_list_nodes) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_diff_iter_t),
            "::",
            stringify!(edge_list_nodes)
        )
    );
}
extern "C" {
    #[doc = "@brief Initialises the tree sequence based on the specified table collection.\n\n@rst\nThis method will copy the supplied table collection unless :c:macro:`TSK_TAKE_OWNERSHIP`\nis specified. The table collection will be checked for integrity and index maps built.\n\nThis must be called before any operations are performed on the tree sequence.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nIf specified, TSK_TAKE_OWNERSHIP takes immediate ownership of the tables, regardless\nof error conditions.\n\nOptions**\n\n- :c:macro:`TSK_TS_INIT_BUILD_INDEXES`\n- :c:macro:`TSK_TAKE_OWNERSHIP` (applies to the table collection).\n@endrst\n\n@param self A pointer to an uninitialised tsk_table_collection_t object.\n@param tables A pointer to a tsk_table_collection_t object.\n@param options Allocation time options. See above for details.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_init(
        self_: *mut tsk_treeseq_t,
        tables: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Load a tree sequence from a file path.\n\n@rst\nLoads the data from the specified file into this tree sequence.\nThe tree sequence is also initialised.\nThe resources allocated must be freed using\n:c:func:`tsk_treeseq_free` even in error conditions.\n\nWorks similarly to :c:func:`tsk_table_collection_load` please see\nthat function's documentation for details and options.\n\nExamples**\n\n.. code-block:: c\n\nint ret;\ntsk_treeseq_t ts;\nret = tsk_treeseq_load(&ts, \"data.trees\", 0);\nif (ret != 0) {\nfprintf(stderr, \"Load error:%s\\n\", tsk_strerror(ret));\nexit(EXIT_FAILURE);\n}\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_treeseq_t object\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_load(
        self_: *mut tsk_treeseq_t,
        filename: *const ::std::os::raw::c_char,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Load a tree sequence from a stream.\n\n@rst\nLoads a tree sequence from the specified file stream. The tree sequence\nis also initialised. The resources allocated must be freed using\n:c:func:`tsk_treeseq_free` even in error conditions.\n\nWorks similarly to :c:func:`tsk_table_collection_loadf` please\nsee that function's documentation for details and options.\n\n@endrst\n\n@param self A pointer to an uninitialised tsk_treeseq_t object.\n@param file A FILE stream opened in an appropriate mode for reading (e.g.\n\"r\", \"r+\" or \"w+\") positioned at the beginning of a tree sequence\ndefinition.\n@param options Bitwise options. See above for details.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_loadf(
        self_: *mut tsk_treeseq_t,
        file: *mut FILE,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Write a tree sequence to file.\n\n@rst\nWrites the data from this tree sequence to the specified file.\n\nIf an error occurs the file path is deleted, ensuring that only complete\nand well formed files will be written.\n@endrst\n\n@param self A pointer to an initialised tsk_treeseq_t object.\n@param filename A NULL terminated string containing the filename.\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_dump(
        self_: *const tsk_treeseq_t,
        filename: *const ::std::os::raw::c_char,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Write a tree sequence to a stream.\n\n@rst\nWrites the data from this tree sequence to the specified FILE stream.\nSemantics are identical to :c:func:`tsk_treeseq_dump`.\n\nPlease see the :ref:`sec_c_api_examples_file_streaming` section for an example\nof how to sequentially dump and load tree sequences from a stream.\n@endrst\n\n@param self A pointer to an initialised tsk_treeseq_t object.\n@param file A FILE stream opened in an appropriate mode for writing (e.g.\n\"w\", \"a\", \"r+\" or \"w+\").\n@param options Bitwise options. Currently unused; should be\nset to zero to ensure compatibility with later versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_dumpf(
        self_: *const tsk_treeseq_t,
        file: *mut FILE,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Copies the state of the table collection underlying this tree sequence\ninto the specified destination table collection.\n\n@rst\nBy default the method initialises the specified destination table collection. If the\ndestination is already initialised, the :c:macro:`TSK_NO_INIT` option should\nbe supplied to avoid leaking memory.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@param tables A pointer to a tsk_table_collection_t object. If the TSK_NO_INIT\noption is specified, this must be an initialised table collection. If not, it must be an\nuninitialised table collection.\n@param options Bitwise option flags.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_copy_tables(
        self_: *const tsk_treeseq_t,
        tables: *mut tsk_table_collection_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified tree sequence.\n\n@param self A pointer to an initialised tsk_treeseq_t object.\n@return Always returns 0."]
    pub fn tsk_treeseq_free(self_: *mut tsk_treeseq_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this tree sequence to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_treeseq_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_treeseq_print_state(self_: *const tsk_treeseq_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Get the number of nodes\n\n@rst\nReturns the number of nodes in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of nodes."]
    pub fn tsk_treeseq_get_num_nodes(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of edges\n\n@rst\nReturns the number of edges in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of edges."]
    pub fn tsk_treeseq_get_num_edges(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of migrations\n\n@rst\nReturns the number of migrations in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of migrations."]
    pub fn tsk_treeseq_get_num_migrations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of sites\n\n@rst\nReturns the number of sites in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of sites."]
    pub fn tsk_treeseq_get_num_sites(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of mutations\n\n@rst\nReturns the number of mutations in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of mutations."]
    pub fn tsk_treeseq_get_num_mutations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of provenances\n\n@rst\nReturns the number of provenances in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of provenances."]
    pub fn tsk_treeseq_get_num_provenances(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of populations\n\n@rst\nReturns the number of populations in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of populations."]
    pub fn tsk_treeseq_get_num_populations(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of individuals\n\n@rst\nReturns the number of individuals in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of individuals."]
    pub fn tsk_treeseq_get_num_individuals(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Return the number of trees in this tree sequence.\n\n@rst\nThis is a constant time operation.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return The number of trees in the tree sequence."]
    pub fn tsk_treeseq_get_num_trees(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the number of samples\n\n@rst\nReturns the number of nodes marked as samples in this tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the number of samples."]
    pub fn tsk_treeseq_get_num_samples(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the top-level tree sequence metadata.\n\n@rst\nReturns a pointer to the metadata string, which is owned by the tree sequence and\nnot null-terminated.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the metadata."]
    pub fn tsk_treeseq_get_metadata(self_: *const tsk_treeseq_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = "@brief Get the length of top-level tree sequence metadata\n\n@rst\nReturns the length of the metadata string.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the length of the metadata."]
    pub fn tsk_treeseq_get_metadata_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the top-level tree sequence metadata schema.\n\n@rst\nReturns a pointer to the metadata schema string, which is owned by the tree sequence and\nnot null-terminated.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the metadata schema."]
    pub fn tsk_treeseq_get_metadata_schema(
        self_: *const tsk_treeseq_t,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = "@brief Get the length of the top-level tree sequence metadata schema.\n\n@rst\nReturns the length of the metadata schema string.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the length of the metadata schema."]
    pub fn tsk_treeseq_get_metadata_schema_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the time units string\n\n@rst\nReturns a pointer to the time units string, which is owned by the tree sequence and\nnot null-terminated.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the time units."]
    pub fn tsk_treeseq_get_time_units(self_: *const tsk_treeseq_t)
        -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = "@brief Get the length of time units string\n@rst\nReturns the length of the time units string.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the length of the time units."]
    pub fn tsk_treeseq_get_time_units_length(self_: *const tsk_treeseq_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Get the file uuid\n\n@rst\nReturns a pointer to the null-terminated file uuid string, which is owned by the tree\nsequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns a pointer to the time units."]
    pub fn tsk_treeseq_get_file_uuid(self_: *const tsk_treeseq_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = "@brief Get the sequence length\n\n@rst\nReturns the sequence length of this tree sequence\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the sequence length."]
    pub fn tsk_treeseq_get_sequence_length(self_: *const tsk_treeseq_t) -> f64;
}
extern "C" {
    #[doc = "@brief Get the breakpoints\n\n@rst\nReturns an array of breakpoint locations, the array is owned by the tree sequence.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the pointer to the breakpoint array."]
    pub fn tsk_treeseq_get_breakpoints(self_: *const tsk_treeseq_t) -> *const f64;
}
extern "C" {
    #[doc = "@brief Get the samples\n\n@rst\nReturns an array of ids of sample nodes in this tree sequence.\nI.e. nodes that have the :c:macro:`TSK_NODE_IS_SAMPLE` flag set.\nThe array is owned by the tree sequence and should not be modified or free'd.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the pointer to the sample node id array."]
    pub fn tsk_treeseq_get_samples(self_: *const tsk_treeseq_t) -> *const tsk_id_t;
}
extern "C" {
    #[doc = "@brief Get the map of node id to sample index\n\n@rst\nReturns the location of each node in the list of samples or\n:c:macro:`TSK_NULL` for nodes that are not samples.\n@endrst\n\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns the pointer to the array of sample indexes."]
    pub fn tsk_treeseq_get_sample_index_map(self_: *const tsk_treeseq_t) -> *const tsk_id_t;
}
extern "C" {
    #[doc = "@brief Check if a node is a sample\n\n@rst\nReturns the sample status of a given node id.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param u The id of the node to be checked.\n@return Returns true if the node is a sample."]
    pub fn tsk_treeseq_is_sample(self_: *const tsk_treeseq_t, u: tsk_id_t) -> bool;
}
extern "C" {
    #[doc = "@brief Get the discrete genome status\n\n@rst\nIf all the genomic locations in the tree sequence are discrete integer values\nthen this flag will be true.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns true if all genomic locations are discrete."]
    pub fn tsk_treeseq_get_discrete_genome(self_: *const tsk_treeseq_t) -> bool;
}
extern "C" {
    #[doc = "@brief Get the discrete time status\n\n@rst\nIf all times in the tree sequence are discrete integer values\nthen this flag will be true\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@return Returns true if all times are discrete."]
    pub fn tsk_treeseq_get_discrete_time(self_: *const tsk_treeseq_t) -> bool;
}
extern "C" {
    #[doc = "@brief Get a node by its index\n\n@rst\nCopies a node from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The node index to copy\n@param node A pointer to a tsk_node_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_node(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        node: *mut tsk_node_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a edge by its index\n\n@rst\nCopies a edge from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The edge index to copy\n@param edge A pointer to a tsk_edge_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_edge(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        edge: *mut tsk_edge_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a edge by its index\n\n@rst\nCopies a migration from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The migration index to copy\n@param migration A pointer to a tsk_migration_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_migration(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        migration: *mut tsk_migration_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a site by its index\n\n@rst\nCopies a site from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The site index to copy\n@param site A pointer to a tsk_site_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_site(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        site: *mut tsk_site_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a mutation by its index\n\n@rst\nCopies a mutation from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The mutation index to copy\n@param mutation A pointer to a tsk_mutation_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_mutation(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        mutation: *mut tsk_mutation_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a provenance by its index\n\n@rst\nCopies a provenance from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The provenance index to copy\n@param provenance A pointer to a tsk_provenance_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_provenance(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        provenance: *mut tsk_provenance_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a population by its index\n\n@rst\nCopies a population from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The population index to copy\n@param population A pointer to a tsk_population_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_population(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        population: *mut tsk_population_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Get a individual by its index\n\n@rst\nCopies a individual from this tree sequence to the specified destination.\n@endrst\n@param self A pointer to a tsk_treeseq_t object.\n@param index The individual index to copy\n@param individual A pointer to a tsk_individual_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_get_individual(
        self_: *const tsk_treeseq_t,
        index: tsk_id_t,
        individual: *mut tsk_individual_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Create a simplified instance of this tree sequence\n\n@rst\nCopies this tree sequence to the specified destination and performs simplification.\nThe destination tree sequence should be uninitialised.\nSimplification transforms the tables to remove redundancy and canonicalise\ntree sequence data. See the :ref:`simplification <sec_simplification>` tutorial for\nmore details.\n\nFor full details and flags see :c:func:`tsk_table_collection_simplify` which performs\nthe same operation in place.\n\n@endrst\n@param self A pointer to a uninitialised tsk_treeseq_t object.\n@param samples Either NULL or an array of num_samples distinct and valid node IDs.\nIf non-null the nodes in this array will be marked as samples in the output.\nIf NULL, the num_samples parameter is ignored and the samples in the output\nwill be the same as the samples in the input. This is equivalent to populating\nthe samples array with all of the sample nodes in the input in increasing\norder of ID.\n@param num_samples The number of node IDs in the input samples array. Ignored\nif the samples array is NULL.\n@param options Simplify options; see above for the available bitwise flags.\nFor the default behaviour, a value of 0 should be provided.\n@param output A pointer to an uninitialised tsk_treeseq_t object.\n@param node_map If not NULL, this array will be filled to define the mapping\nbetween nodes IDs in the table collection before and after simplification.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_treeseq_simplify(
        self_: *const tsk_treeseq_t,
        samples: *const tsk_id_t,
        num_samples: tsk_size_t,
        options: tsk_flags_t,
        output: *mut tsk_treeseq_t,
        node_map: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_treeseq_split_edges(
        self_: *const tsk_treeseq_t,
        time: f64,
        flags: tsk_flags_t,
        population: tsk_id_t,
        metadata: *const ::std::os::raw::c_char,
        metadata_length: tsk_size_t,
        options: tsk_flags_t,
        output: *mut tsk_treeseq_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_has_reference_sequence(self_: *const tsk_treeseq_t) -> bool;
}
extern "C" {
    pub fn tsk_treeseq_get_individuals_population(
        self_: *const tsk_treeseq_t,
        output: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_get_individuals_time(
        self_: *const tsk_treeseq_t,
        output: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_kc_distance(
        self_: *const tsk_treeseq_t,
        other: *const tsk_treeseq_t,
        lambda_: f64,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_genealogical_nearest_neighbours(
        self_: *const tsk_treeseq_t,
        focal: *const tsk_id_t,
        num_focal: tsk_size_t,
        reference_sets: *const *const tsk_id_t,
        reference_set_size: *const tsk_size_t,
        num_reference_sets: tsk_size_t,
        options: tsk_flags_t,
        ret_array: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_mean_descendants(
        self_: *const tsk_treeseq_t,
        reference_sets: *const *const tsk_id_t,
        reference_set_size: *const tsk_size_t,
        num_reference_sets: tsk_size_t,
        options: tsk_flags_t,
        ret_array: *mut f64,
    ) -> ::std::os::raw::c_int;
}
pub type general_stat_func_t = ::std::option::Option<
    unsafe extern "C" fn(
        state_dim: tsk_size_t,
        state: *const f64,
        result_dim: tsk_size_t,
        result: *mut f64,
        params: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn tsk_treeseq_general_stat(
        self_: *const tsk_treeseq_t,
        K: tsk_size_t,
        W: *const f64,
        M: tsk_size_t,
        f: general_stat_func_t,
        f_params: *mut ::std::os::raw::c_void,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_trait_covariance(
        self_: *const tsk_treeseq_t,
        num_weights: tsk_size_t,
        weights: *const f64,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_trait_correlation(
        self_: *const tsk_treeseq_t,
        num_weights: tsk_size_t,
        weights: *const f64,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_trait_linear_model(
        self_: *const tsk_treeseq_t,
        num_weights: tsk_size_t,
        weights: *const f64,
        num_covariates: tsk_size_t,
        covariates: *const f64,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_diversity(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_segregating_sites(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_Y1(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_allele_frequency_spectrum(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_divergence(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_Y2(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_f2(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_genetic_relatedness(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_Y3(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_f3(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_treeseq_f4(
        self_: *const tsk_treeseq_t,
        num_sample_sets: tsk_size_t,
        sample_set_sizes: *const tsk_size_t,
        sample_sets: *const tsk_id_t,
        num_index_tuples: tsk_size_t,
        index_tuples: *const tsk_id_t,
        num_windows: tsk_size_t,
        windows: *const f64,
        options: tsk_flags_t,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Initialises the tree by allocating internal memory and associating\nwith the specified tree sequence.\n\n@rst\nThis must be called before any operations are performed on the tree.\n\nThe specified tree sequence object must be initialised, and must be\nvalid for the full lifetime of this tree.\n\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n\nThe ``options`` parameter is provided to support future expansions\nof the API. A number of undocumented internal features are controlled\nvia this parameter, and it **must** be set to 0 to ensure that operations\nwork as expected and for compatibility with future versions of tskit.\n@endrst\n\n@param self A pointer to an uninitialised tsk_tree_t object.\n@param tree_sequence A pointer to an initialised tsk_treeseq_t object.\n@param options Allocation time options. Must be 0, or behaviour is undefined.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_tree_init(
        self_: *mut tsk_tree_t,
        tree_sequence: *const tsk_treeseq_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified tree.\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Always returns 0."]
    pub fn tsk_tree_free(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Copies the state of this tree into the specified destination.\n\n@rst\nBy default (``options`` = 0) the method initialises the specified destination\ntree by calling :c:func:`tsk_tree_init`. If the destination is already\ninitialised, the :c:macro:`TSK_NO_INIT` option should be supplied to avoid\nleaking memory. If :c:macro:`TSK_NO_INIT` is supplied and the tree sequence associated\nwith the ``dest`` tree is not equal to the tree sequence associated\nwith ``self``, an error is raised.\n\nThe destination tree will keep a reference to the tree sequence object\nassociated with the source tree, and this tree sequence must be\nvalid for the full lifetime of the destination tree.\n\nOptions**\n\n- :c:macro:`TSK_NO_INIT`\n\nIf :c:macro:`TSK_NO_INIT` is not specified, options for :c:func:`tsk_tree_init`\ncan be provided and will be passed on.\n\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@param dest A pointer to a tsk_tree_t object. If the TSK_NO_INIT option\nis specified, this must be an initialised tree. If not, it must\nbe an uninitialised tree.\n@param options Copy and allocation time options. See the notes above for details.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_tree_copy(
        self_: *const tsk_tree_t,
        dest: *mut tsk_tree_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Seek to the first tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the first tree in parent\ntree sequence.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on success; or a negative value if an error occurs."]
    pub fn tsk_tree_first(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Seek to the last tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the last tree in parent\ntree sequence.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on success; or a negative value if an error occurs."]
    pub fn tsk_tree_last(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Seek to the next tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the next tree in parent\ntree sequence. If the index of the current tree is ``j``,\nthen the after this operation the index will be ``j + 1``.\n\nCalling :c:func:`tsk_tree_next` a tree in the\n:ref:`null state<sec_c_api_trees_null>` is equivalent to calling\n:c:func:`tsk_tree_first`.\n\nCalling :c:func:`tsk_tree_next` on the last tree in the\nsequence will transform it into the\n:ref:`null state<sec_c_api_trees_null>` (equivalent to\ncalling :c:func:`tsk_tree_clear`).\n\nPlease see the :ref:`sec_c_api_examples_tree_iteration` examples for\nrecommended usage.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on successfully transforming to a\nnon-null tree; 0 on successfully transforming into the null\ntree; or a negative value if an error occurs."]
    pub fn tsk_tree_next(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Seek to the previous tree in the sequence.\n\n@rst\nSet the state of this tree to reflect the previous tree in parent\ntree sequence. If the index of the current tree is ``j``,\nthen the after this operation the index will be ``j - 1``.\n\nCalling :c:func:`tsk_tree_prev` a tree in the\n:ref:`null state<sec_c_api_trees_null>` is equivalent to calling\n:c:func:`tsk_tree_last`.\n\nCalling :c:func:`tsk_tree_prev` on the first tree in the\nsequence will transform it into the\n:ref:`null state<sec_c_api_trees_null>` (equivalent to\ncalling :c:func:`tsk_tree_clear`).\n\nPlease see the :ref:`sec_c_api_examples_tree_iteration` examples for\nrecommended usage.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return TSK_TREE_OK on successfully transforming to a\nnon-null tree; 0 on successfully transforming into the null\ntree; or a negative value if an error occurs."]
    pub fn tsk_tree_prev(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Set the tree into the null state.\n\n@rst\nTransform this tree into the :ref:`null state<sec_c_api_trees_null>`.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_tree_clear(self_: *mut tsk_tree_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Seek to a particular position on the genome.\n\n@rst\nSet the state of this tree to reflect the tree in parent\ntree sequence covering the specified ``position``. That is, on success\nwe will have ``tree.interval.left <= position`` and\nwe will have ``position < tree.interval.right``.\n\nSeeking to a position currently covered by the tree is\na constant time operation.\n\n.. warning::\nThe current implementation of ``seek`` does **not** provide efficient\nrandom access to arbitrary positions along the genome. However,\nsequentially seeking in either direction is as efficient as calling\n:c:func:`tsk_tree_next` or :c:func:`tsk_tree_prev` directly.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@param position The position in genome coordinates\n@param options Seek options. Currently unused. Set to 0 for compatibility\nwith future versions of tskit.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_tree_seek(
        self_: *mut tsk_tree_t,
        position: f64,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns the number of roots in this tree.\n\n@rst\nSee the :ref:`sec_data_model_tree_roots` section for more information\non how the roots of a tree are defined.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Returns the number roots in this tree."]
    pub fn tsk_tree_get_num_roots(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Returns the leftmost root in this tree.\n\n@rst\nSee the :ref:`sec_data_model_tree_roots` section for more information\non how the roots of a tree are defined.\n\nThis function is equivalent to ``tree.left_child[tree.virtual_root]``.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Returns the leftmost root in the tree."]
    pub fn tsk_tree_get_left_root(self_: *const tsk_tree_t) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Returns the rightmost root in this tree.\n\n@rst\nSee the :ref:`sec_data_model_tree_roots` section for more information\non how the roots of a tree are defined.\n\nThis function is equivalent to ``tree.right_child[tree.virtual_root]``.\n@endrst\n\n@param self A pointer to an initialised tsk_tree_t object.\n@return Returns the rightmost root in the tree."]
    pub fn tsk_tree_get_right_root(self_: *const tsk_tree_t) -> tsk_id_t;
}
extern "C" {
    #[doc = "@brief Get the list of sites for this tree.\n\n@rst\nGets the list of :c:data:`tsk_site_t` objects in the parent tree sequence\nfor which the position lies within this tree's genomic interval.\n\nThe memory pointed to by the ``sites`` parameter is managed by the\n``tsk_tree_t`` object and must not be altered or freed by client code.\n\n.. code-block:: c\n\nstatic void\nprint_sites(const tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t j, num_sites;\nconst tsk_site_t *sites;\n\nret = tsk_tree_get_sites(tree, &sites, &num_sites);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_sites; j++) {\nprintf(\"position = %f\\n\", sites[j].position);\n}\n}\n\nThis is a constant time operation.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param sites The destination pointer for the list of sites.\n@param sites_length A pointer to a tsk_size_t value in which the number\nof sites is stored.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_sites(
        self_: *const tsk_tree_t,
        sites: *mut *const tsk_site_t,
        sites_length: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Return an upper bound on the number of nodes reachable\nfrom the roots of this tree.\n\n@rst\nThis function provides an upper bound on the number of nodes that\ncan be reached in tree traversals, and is intended to be used\nfor memory allocation purposes. If ``num_nodes`` is the number\nof nodes visited in a tree traversal from the\n:ref:`virtual root<sec_data_model_tree_roots>`\n(e.g., ``tsk_tree_preorder_from(tree, tree->virtual_root, nodes,\n&num_nodes)``), the bound ``N`` returned here is guaranteed to\nbe greater than or equal to ``num_nodes``.\n\n.. warning:: The precise value returned is not defined and should\nnot be depended on, as it may change from version-to-version.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@return An upper bound on the number nodes reachable from the roots\nof this tree, or zero if this tree has not been initialised."]
    pub fn tsk_tree_get_size_bound(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
    #[doc = "@brief Print out the state of this tree to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_tree_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_tree_print_state(self_: *const tsk_tree_t, out: *mut FILE);
}
extern "C" {
    #[doc = "@brief Returns the parent of the specified node.\n\n@rst\nEquivalent to ``tree.parent[u]`` with bounds checking for the node u.\nPerformance sensitive code which can guarantee that the node u is\nvalid should use the direct array access in preference to this method.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param parent A tsk_id_t pointer to store the returned parent node.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_parent(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        parent: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns the time of the specified node.\n\n@rst\nEquivalent to ``tables->nodes.time[u]`` with bounds checking for the node u.\nPerformance sensitive code which can guarantee that the node u is\nvalid should use the direct array access in preference to this method,\nfor example:\n\n.. code-block:: c\n\nstatic void\nprint_times(const tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t num_nodes, j;\nconst double *node_time = tree->tree_sequence->tables->nodes.time;\ntsk_id_t *nodes = malloc(tsk_tree_get_size_bound(tree) * sizeof(*nodes));\n\nif (nodes == NULL) {\nerrx(EXIT_FAILURE, \"Out of memory\");\n}\nret = tsk_tree_preorder(tree, nodes, &num_nodes);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_nodes; j++) {\nprintf(\"time = %f\\n\", node_time[nodes[j]]);\n}\nfree(nodes);\n}\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_time A double pointer to store the returned node time.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_time(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        ret_time: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Return number of nodes on the path from the specified node to root.\n\n@rst\nReturn the number of nodes on the path from u to root, not including u.\nThe depth of a root is therefore zero.\n\nAs a special case, the depth of the\n:ref:`virtual root <sec_data_model_tree_roots>` is defined as -1.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_depth An int pointer to store the returned node depth.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_depth(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        ret_depth: *mut ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Return the length of the branch ancestral to the specified node.\n\n@rst\nReturn the length of the branch ancestral to the specified node.\nBranch length is defined as difference between the time\nof a node and its parent. The branch length of a root is zero.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_branch_length A double pointer to store the returned branch length.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_branch_length(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        ret_branch_length: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Computes the sum of the lengths of all branches reachable from\nthe specified node, or from all roots if ``u=TSK_NULL``.\n\n@rst\nReturn the total branch length in a particular subtree or of the\nentire tree. If the specified node is :c:macro:`TSK_NULL` (or the\n:ref:`virtual root<sec_data_model_tree_roots>`)\nthe sum of the lengths of all branches reachable from roots\nis returned. Branch length is defined as difference between the time\nof a node and its parent. The branch length of a root is zero.\n\nNote that if the specified node is internal its branch length is\nnot* included, so that, e.g., the total branch length of a\nleaf node is zero.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The root of the subtree of interest, or ``TSK_NULL`` to return the\ntotal branch length of the tree.\n@param ret_tbl A double pointer to store the returned total branch length.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_total_branch_length(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        ret_tbl: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Counts the number of samples in the subtree rooted at a node.\n\n@rst\nReturns the number of samples descending from a particular node,\nincluding the node itself.\n\nThis is a constant time operation.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The tree node.\n@param ret_num_samples A tsk_size_t pointer to store the returned\nnumber of samples.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_num_samples(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        ret_num_samples: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Compute the most recent common ancestor of two nodes.\n\n@rst\nIf two nodes do not share a common ancestor in the current tree, the MRCA\nnode is :c:macro:`TSK_NULL`.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u A tree node.\n@param v A tree node.\n@param mrca A tsk_id_t pointer to store the returned most recent common ancestor node.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_get_mrca(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        v: tsk_id_t,
        mrca: *mut tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Returns true if u is a descendant of v.\n\n@rst\nReturns true if u and v are both valid nodes in the tree sequence\nand v lies on the path from u to root, and false otherwise.\n\nAny node is a descendant of itself.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param u The descendant node.\n@param v The ancestral node.\n@return true if u is a descendant of v, and false otherwise."]
    pub fn tsk_tree_is_descendant(self_: *const tsk_tree_t, u: tsk_id_t, v: tsk_id_t) -> bool;
}
extern "C" {
    #[doc = "@brief Fill an array with the nodes of this tree in preorder.\n\n@rst\nPopulate an array with the nodes in this tree in preorder. The array\nmust be pre-allocated and be sufficiently large to hold the array\nof nodes visited. The recommended approach is to use the\n:c:func:`tsk_tree_get_size_bound` function, as in the following example:\n\n.. code-block:: c\n\nstatic void\nprint_preorder(tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t num_nodes, j;\ntsk_id_t *nodes = malloc(tsk_tree_get_size_bound(tree) * sizeof(*nodes));\n\nif (nodes == NULL) {\nerrx(EXIT_FAILURE, \"Out of memory\");\n}\nret = tsk_tree_preorder(tree, nodes, &num_nodes);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_nodes; j++) {\nprintf(\"Visit preorder %lld\\n\", (long long) nodes[j]);\n}\nfree(nodes);\n}\n\n.. seealso::\nSee the :ref:`sec_c_api_examples_tree_traversals` section for\nmore examples.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param nodes The tsk_id_t array to store nodes in. See notes above for\ndetails.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_preorder(
        self_: *const tsk_tree_t,
        nodes: *mut tsk_id_t,
        num_nodes: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Fill an array with the nodes of this tree starting from a particular node.\n\n@rst\nAs for :c:func:`tsk_tree_preorder` but starting the traversal at a particular node\n(which will be the first node in the traversal list). The\n:ref:`virtual root<sec_data_model_tree_roots>` is a valid input for this function\nand will be treated like any other tree node. The value ``-1`` is a special case,\nin which we visit all nodes reachable from the roots, and equivalent to\ncalling :c:func:`tsk_tree_preorder`.\n\nSee :c:func:`tsk_tree_preorder` for details the requirements for the ``nodes``\narray.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param root The root of the subtree to traverse, or -1 to visit all nodes.\n@param nodes The tsk_id_t array to store nodes in.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_preorder_from(
        self_: *const tsk_tree_t,
        root: tsk_id_t,
        nodes: *mut tsk_id_t,
        num_nodes: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Fill an array with the nodes of this tree in postorder.\n\n@rst\nPopulate an array with the nodes in this tree in postorder. The array\nmust be pre-allocated and be sufficiently large to hold the array\nof nodes visited. The recommended approach is to use the\n:c:func:`tsk_tree_get_size_bound` function, as in the following example:\n\n.. code-block:: c\n\nstatic void\nprint_postorder(tsk_tree_t *tree)\n{\nint ret;\ntsk_size_t num_nodes, j;\ntsk_id_t *nodes = malloc(tsk_tree_get_size_bound(tree) * sizeof(*nodes));\n\nif (nodes == NULL) {\nerrx(EXIT_FAILURE, \"Out of memory\");\n}\nret = tsk_tree_postorder(tree, nodes, &num_nodes);\ncheck_tsk_error(ret);\nfor (j = 0; j < num_nodes; j++) {\nprintf(\"Visit postorder %lld\\n\", (long long) nodes[j]);\n}\nfree(nodes);\n}\n\n.. seealso::\nSee the :ref:`sec_c_api_examples_tree_traversals` section for\nmore examples.\n\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param nodes The tsk_id_t array to store nodes in. See notes above for\ndetails.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_postorder(
        self_: *const tsk_tree_t,
        nodes: *mut tsk_id_t,
        num_nodes: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Fill an array with the nodes of this tree starting from a particular node.\n\n@rst\nAs for :c:func:`tsk_tree_postorder` but starting the traversal at a particular node\n(which will be the last node in the traversal list). The\n:ref:`virtual root<sec_data_model_tree_roots>` is a valid input for this function\nand will be treated like any other tree node. The value ``-1`` is a special case,\nin which we visit all nodes reachable from the roots, and equivalent to\ncalling :c:func:`tsk_tree_postorder`.\n\nSee :c:func:`tsk_tree_postorder` for details the requirements for the ``nodes``\narray.\n@endrst\n\n@param self A pointer to a tsk_tree_t object.\n@param root The root of the subtree to traverse, or -1 to visit all nodes.\n@param nodes The tsk_id_t array to store nodes in. See\n:c:func:`tsk_tree_postorder` for more details.\n@param num_nodes A pointer to a tsk_size_t value where we store the number\nof nodes in the traversal.\n@return 0 on success or a negative value on failure."]
    pub fn tsk_tree_postorder_from(
        self_: *const tsk_tree_t,
        root: tsk_id_t,
        nodes: *mut tsk_id_t,
        num_nodes: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_tree_preorder_samples_from(
        self_: *const tsk_tree_t,
        root: tsk_id_t,
        nodes: *mut tsk_id_t,
        num_nodes: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_set_root_threshold(
        self_: *mut tsk_tree_t,
        root_threshold: tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_get_root_threshold(self_: *const tsk_tree_t) -> tsk_size_t;
}
extern "C" {
    pub fn tsk_tree_has_sample_counts(self_: *const tsk_tree_t) -> bool;
}
extern "C" {
    pub fn tsk_tree_has_sample_lists(self_: *const tsk_tree_t) -> bool;
}
extern "C" {
    pub fn tsk_tree_get_num_tracked_samples(
        self_: *const tsk_tree_t,
        u: tsk_id_t,
        num_tracked_samples: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_set_tracked_samples(
        self_: *mut tsk_tree_t,
        num_tracked_samples: tsk_size_t,
        tracked_samples: *const tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_track_descendant_samples(
        self_: *mut tsk_tree_t,
        node: tsk_id_t,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_state_transition_t {
    pub node: tsk_id_t,
    pub parent: tsk_id_t,
    pub state: i32,
}
#[test]
fn bindgen_test_layout_tsk_state_transition_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_state_transition_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_state_transition_t>(),
        12usize,
        concat!("Size of: ", stringify!(tsk_state_transition_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_state_transition_t>(),
        4usize,
        concat!("Alignment of ", stringify!(tsk_state_transition_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_state_transition_t),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_state_transition_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_state_transition_t),
            "::",
            stringify!(state)
        )
    );
}
extern "C" {
    pub fn tsk_tree_map_mutations(
        self_: *mut tsk_tree_t,
        genotypes: *mut i32,
        cost_matrix: *mut f64,
        options: tsk_flags_t,
        ancestral_state: *mut i32,
        num_transitions: *mut tsk_size_t,
        transitions: *mut *mut tsk_state_transition_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_kc_distance(
        self_: *const tsk_tree_t,
        other: *const tsk_tree_t,
        lambda: f64,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_sackin_index(
        self_: *const tsk_tree_t,
        result: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_colless_index(
        self_: *const tsk_tree_t,
        result: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_b1_index(self_: *const tsk_tree_t, result: *mut f64) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_b2_index(
        self_: *const tsk_tree_t,
        base: f64,
        result: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_num_lineages(
        self_: *const tsk_tree_t,
        t: f64,
        result: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_tree_is_sample(self_: *const tsk_tree_t, u: tsk_id_t) -> bool;
}
extern "C" {
    pub fn tsk_tree_equals(self_: *const tsk_tree_t, other: *const tsk_tree_t) -> bool;
}
extern "C" {
    pub fn tsk_diff_iter_init(
        self_: *mut tsk_diff_iter_t,
        tree_sequence: *const tsk_treeseq_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_diff_iter_free(self_: *mut tsk_diff_iter_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_diff_iter_next(
        self_: *mut tsk_diff_iter_t,
        left: *mut f64,
        right: *mut f64,
        edges_out: *mut tsk_edge_list_t,
        edges_in: *mut tsk_edge_list_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_diff_iter_print_state(self_: *const tsk_diff_iter_t, out: *mut FILE);
}
#[doc = "@brief A variant at a specific site.\n\n@rst\nUsed to generate the genotypes for a given set of samples at a given\nsite.\n@endrst"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_variant_t {
    #[doc = " @brief Unowned reference to the tree sequence of the variant"]
    pub tree_sequence: *const tsk_treeseq_t,
    #[doc = " @brief The site this variant is currently decoded at"]
    pub site: tsk_site_t,
    pub tree: tsk_tree_t,
    #[doc = " @brief Array of allele strings that the genotypes of the variant refer to\n  These are not NULL terminated - use `allele_lengths` for example:.\n  `printf(\"%.*s\", (int) var->allele_lengths[j], var->alleles[j]);`"]
    pub alleles: *mut *const ::std::os::raw::c_char,
    #[doc = " @brief Lengths of the allele strings"]
    pub allele_lengths: *mut tsk_size_t,
    #[doc = " @brief Length of the allele array"]
    pub num_alleles: tsk_size_t,
    pub max_alleles: tsk_size_t,
    #[doc = " @brief If True the genotypes of isolated nodes have been decoded to the \"missing\"\n genotype. If False they are set to the ancestral state (in the absence of\n mutations above them)"]
    pub has_missing_data: bool,
    #[doc = " @brief Array of genotypes for the current site"]
    pub genotypes: *mut i32,
    #[doc = " @brief Number of samples"]
    pub num_samples: tsk_size_t,
    #[doc = " @brief Array of sample ids used"]
    pub samples: *mut tsk_id_t,
    pub sample_index_map: *const tsk_id_t,
    pub user_alleles: bool,
    pub user_alleles_mem: *mut ::std::os::raw::c_char,
    pub traversal_stack: *mut tsk_id_t,
    pub options: tsk_flags_t,
    pub alt_samples: *mut tsk_id_t,
    pub alt_sample_index_map: *mut tsk_id_t,
}
#[test]
fn bindgen_test_layout_tsk_variant_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_variant_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_variant_t>(),
        400usize,
        concat!("Size of: ", stringify!(tsk_variant_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_variant_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_variant_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(site)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(tree)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).alleles) as usize - ptr as usize },
        280usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(alleles)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).allele_lengths) as usize - ptr as usize },
        288usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(allele_lengths)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_alleles) as usize - ptr as usize },
        296usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(num_alleles)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_alleles) as usize - ptr as usize },
        304usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(max_alleles)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).has_missing_data) as usize - ptr as usize },
        312usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(has_missing_data)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).genotypes) as usize - ptr as usize },
        320usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(genotypes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
        328usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(num_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).samples) as usize - ptr as usize },
        336usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sample_index_map) as usize - ptr as usize },
        344usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(sample_index_map)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).user_alleles) as usize - ptr as usize },
        352usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(user_alleles)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).user_alleles_mem) as usize - ptr as usize },
        360usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(user_alleles_mem)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).traversal_stack) as usize - ptr as usize },
        368usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(traversal_stack)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
        376usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(options)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).alt_samples) as usize - ptr as usize },
        384usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(alt_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).alt_sample_index_map) as usize - ptr as usize },
        392usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_variant_t),
            "::",
            stringify!(alt_sample_index_map)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_vargen_t {
    pub tree_sequence: *const tsk_treeseq_t,
    pub site_index: tsk_id_t,
    pub variant: tsk_variant_t,
}
#[test]
fn bindgen_test_layout_tsk_vargen_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_vargen_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_vargen_t>(),
        416usize,
        concat!("Size of: ", stringify!(tsk_vargen_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_vargen_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_vargen_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_vargen_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site_index) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_vargen_t),
            "::",
            stringify!(site_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).variant) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_vargen_t),
            "::",
            stringify!(variant)
        )
    );
}
extern "C" {
    #[doc = "@brief Initialises the variant by allocating the internal memory\n\n@rst\nThis must be called before any operations are performed on the variant.\nSee the :ref:`sec_c_api_overview_structure` for details on how objects\nare initialised and freed.\n@endrst\n\n@param self A pointer to an uninitialised tsk_variant_t object.\n@param tree_sequence A pointer to the tree sequence from which this variant\nwill decode genotypes. No copy is taken, so this tree sequence must persist\nfor the lifetime of the variant.\n@param samples Optional. Either `NULL` or an array of node ids of the samples that are to\nhave their genotypes decoded. A copy of this array will be taken by the variant. If\n`NULL` then the samples from the tree sequence will be used.\n@param num_samples The number of ids in the samples array, ignored if `samples` is `NULL`\n@param alleles Optional. Either ``NULL`` or an array of string alleles with a terminal\n``NULL`` sentinel value.\nIf specified, the genotypes will be decoded to match the index in this allele array.\nIf ``NULL`` then alleles will be automatically determined from the mutations encountered.\n@param options Variant options. Either ``0`` or ``TSK_ISOLATED_NOT_MISSING`` which\nif specified indicates that isolated sample nodes should not be decoded as the \"missing\"\nstate but as the ancestral state (or the state of any mutation above them).\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_variant_init(
        self_: *mut tsk_variant_t,
        tree_sequence: *const tsk_treeseq_t,
        samples: *const tsk_id_t,
        num_samples: tsk_size_t,
        alleles: *mut *const ::std::os::raw::c_char,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Copies the state of this variant to another variant\n\n@rst\nCopies the site, genotypes and alleles from this variant to another. Note that\nthe other variant should be uninitialised as this method does not free any\nmemory that the other variant owns. After copying `other` is frozen and\nthis restricts it from being further decoded at any site. `self` remains unchanged.\n@endrst\n\n@param self A pointer to an initialised and decoded tsk_variant_t object.\n@param other A pointer to an uninitialised tsk_variant_t object.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_variant_restricted_copy(
        self_: *const tsk_variant_t,
        other: *mut tsk_variant_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Decode the genotypes at the given site, storing them in this variant.\n\n@rst\nDecodes the genotypes for this variant's samples, indexed to this variant's alleles,\nat the specified site.\nThis method is most efficient at decoding sites in-order, either forwards or backwards\nalong the tree sequence. Resulting genotypes are stored in the ``genotypes`` member of\nthis variant.\n@endrst\n\n@param self A pointer to an initialised tsk_variant_t object.\n@param site_id A valid site id for the tree sequence of this variant.\n@param options Bitwise option flags. Currently unused; should be\nset to zero to ensure compatibility with later versions of `tskit`.\n@return Return 0 on success or a negative value on failure."]
    pub fn tsk_variant_decode(
        self_: *mut tsk_variant_t,
        site_id: tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Free the internal memory for the specified variant.\n\n@param self A pointer to an initialised tsk_variant_t object.\n@return Always returns 0."]
    pub fn tsk_variant_free(self_: *mut tsk_variant_t) -> ::std::os::raw::c_int;
}
extern "C" {
    #[doc = "@brief Print out the state of this variant to the specified stream.\n\nThis method is intended for debugging purposes and should not be used\nin production code. The format of the output should **not** be depended\non and may change arbitrarily between versions.\n\n@param self A pointer to a tsk_variant_t object.\n@param out The stream to write the summary to."]
    pub fn tsk_variant_print_state(self_: *const tsk_variant_t, out: *mut FILE);
}
extern "C" {
    #[doc = " @}"]
    pub fn tsk_vargen_init(
        self_: *mut tsk_vargen_t,
        tree_sequence: *const tsk_treeseq_t,
        samples: *const tsk_id_t,
        num_samples: tsk_size_t,
        alleles: *mut *const ::std::os::raw::c_char,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_vargen_next(
        self_: *mut tsk_vargen_t,
        variant: *mut *mut tsk_variant_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_vargen_free(self_: *mut tsk_vargen_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_vargen_print_state(self_: *const tsk_vargen_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_convert_newick(
        tree: *const tsk_tree_t,
        root: tsk_id_t,
        precision: ::std::os::raw::c_uint,
        options: tsk_flags_t,
        buffer_size: usize,
        buffer: *mut ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_ld_calc_t {
    pub tree_sequence: *const tsk_treeseq_t,
    pub focal_site: tsk_site_t,
    pub total_samples: tsk_size_t,
    pub focal_samples: tsk_size_t,
    pub max_distance: f64,
    pub max_sites: tsk_size_t,
    pub tree: tsk_tree_t,
    pub sample_buffer: *mut tsk_id_t,
    pub result: *mut f64,
    pub result_length: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_ld_calc_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_ld_calc_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_ld_calc_t>(),
        336usize,
        concat!("Size of: ", stringify!(tsk_ld_calc_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_ld_calc_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_ld_calc_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).focal_site) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(focal_site)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).total_samples) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(total_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).focal_samples) as usize - ptr as usize },
        80usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(focal_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_distance) as usize - ptr as usize },
        88usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(max_distance)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_sites) as usize - ptr as usize },
        96usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(max_sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree) as usize - ptr as usize },
        104usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(tree)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).sample_buffer) as usize - ptr as usize },
        312usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(sample_buffer)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).result) as usize - ptr as usize },
        320usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(result)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).result_length) as usize - ptr as usize },
        328usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_ld_calc_t),
            "::",
            stringify!(result_length)
        )
    );
}
extern "C" {
    pub fn tsk_ld_calc_init(
        self_: *mut tsk_ld_calc_t,
        tree_sequence: *const tsk_treeseq_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ld_calc_free(self_: *mut tsk_ld_calc_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ld_calc_print_state(self_: *const tsk_ld_calc_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_ld_calc_get_r2(
        self_: *mut tsk_ld_calc_t,
        a: tsk_id_t,
        b: tsk_id_t,
        r2: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ld_calc_get_r2_array(
        self_: *mut tsk_ld_calc_t,
        a: tsk_id_t,
        direction: ::std::os::raw::c_int,
        max_sites: tsk_size_t,
        max_distance: f64,
        r2: *mut f64,
        num_r2_values: *mut tsk_size_t,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_value_transition_t {
    pub tree_node: tsk_id_t,
    pub value_index: tsk_id_t,
    pub value: f64,
}
#[test]
fn bindgen_test_layout_tsk_value_transition_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_value_transition_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_value_transition_t>(),
        16usize,
        concat!("Size of: ", stringify!(tsk_value_transition_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_value_transition_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_value_transition_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_node) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_value_transition_t),
            "::",
            stringify!(tree_node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).value_index) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_value_transition_t),
            "::",
            stringify!(value_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_value_transition_t),
            "::",
            stringify!(value)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_argsort_t {
    pub index: tsk_size_t,
    pub value: f64,
}
#[test]
fn bindgen_test_layout_tsk_argsort_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_argsort_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_argsort_t>(),
        16usize,
        concat!("Size of: ", stringify!(tsk_argsort_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_argsort_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_argsort_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_argsort_t),
            "::",
            stringify!(index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_argsort_t),
            "::",
            stringify!(value)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_transition_stack_t {
    pub tree_node: tsk_id_t,
    pub old_state: tsk_id_t,
    pub new_state: tsk_id_t,
    pub transition_parent: tsk_id_t,
}
#[test]
fn bindgen_test_layout_tsk_transition_stack_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_transition_stack_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_transition_stack_t>(),
        16usize,
        concat!("Size of: ", stringify!(tsk_transition_stack_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_transition_stack_t>(),
        4usize,
        concat!("Alignment of ", stringify!(tsk_transition_stack_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_node) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_transition_stack_t),
            "::",
            stringify!(tree_node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).old_state) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_transition_stack_t),
            "::",
            stringify!(old_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).new_state) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_transition_stack_t),
            "::",
            stringify!(new_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transition_parent) as usize - ptr as usize },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_transition_stack_t),
            "::",
            stringify!(transition_parent)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_site_probability_t {
    pub normalisation_factor: f64,
    pub value: *mut f64,
    pub node: *mut tsk_id_t,
    pub num_values: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_site_probability_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_site_probability_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_site_probability_t>(),
        32usize,
        concat!("Size of: ", stringify!(tsk_site_probability_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_site_probability_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_site_probability_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).normalisation_factor) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_probability_t),
            "::",
            stringify!(normalisation_factor)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_probability_t),
            "::",
            stringify!(value)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_probability_t),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_values) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_site_probability_t),
            "::",
            stringify!(num_values)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_compressed_matrix_t {
    pub tree_sequence: *mut tsk_treeseq_t,
    pub options: tsk_flags_t,
    pub num_sites: tsk_size_t,
    pub num_samples: tsk_size_t,
    pub normalisation_factor: *mut f64,
    pub num_transitions: *mut tsk_size_t,
    pub values: *mut *mut f64,
    pub nodes: *mut *mut tsk_id_t,
    pub memory: tsk_blkalloc_t,
}
#[test]
fn bindgen_test_layout_tsk_compressed_matrix_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_compressed_matrix_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_compressed_matrix_t>(),
        120usize,
        concat!("Size of: ", stringify!(tsk_compressed_matrix_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_compressed_matrix_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_compressed_matrix_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).options) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(options)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_sites) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(num_sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(num_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).normalisation_factor) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(normalisation_factor)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_transitions) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(num_transitions)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).values) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(values)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).memory) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_compressed_matrix_t),
            "::",
            stringify!(memory)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_recomb_required_record {
    pub site: tsk_id_t,
    pub node: tsk_id_t,
    pub required: bool,
}
#[test]
fn bindgen_test_layout_tsk_recomb_required_record() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_recomb_required_record> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_recomb_required_record>(),
        12usize,
        concat!("Size of: ", stringify!(tsk_recomb_required_record))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_recomb_required_record>(),
        4usize,
        concat!("Alignment of ", stringify!(tsk_recomb_required_record))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).site) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_recomb_required_record),
            "::",
            stringify!(site)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_recomb_required_record),
            "::",
            stringify!(node)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).required) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_recomb_required_record),
            "::",
            stringify!(required)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tsk_viterbi_matrix_t {
    pub matrix: tsk_compressed_matrix_t,
    pub recombination_required: *mut tsk_recomb_required_record,
    pub num_recomb_records: tsk_size_t,
    pub max_recomb_records: tsk_size_t,
}
#[test]
fn bindgen_test_layout_tsk_viterbi_matrix_t() {
    const UNINIT: ::std::mem::MaybeUninit<tsk_viterbi_matrix_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<tsk_viterbi_matrix_t>(),
        144usize,
        concat!("Size of: ", stringify!(tsk_viterbi_matrix_t))
    );
    assert_eq!(
        ::std::mem::align_of::<tsk_viterbi_matrix_t>(),
        8usize,
        concat!("Alignment of ", stringify!(tsk_viterbi_matrix_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).matrix) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_viterbi_matrix_t),
            "::",
            stringify!(matrix)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).recombination_required) as usize - ptr as usize },
        120usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_viterbi_matrix_t),
            "::",
            stringify!(recombination_required)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_recomb_records) as usize - ptr as usize },
        128usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_viterbi_matrix_t),
            "::",
            stringify!(num_recomb_records)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_recomb_records) as usize - ptr as usize },
        136usize,
        concat!(
            "Offset of field: ",
            stringify!(tsk_viterbi_matrix_t),
            "::",
            stringify!(max_recomb_records)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _tsk_ls_hmm_t {
    pub tree_sequence: *mut tsk_treeseq_t,
    pub recombination_rate: *mut f64,
    pub mutation_rate: *mut f64,
    pub alleles: *mut *mut *const ::std::os::raw::c_char,
    pub precision: ::std::os::raw::c_uint,
    pub num_alleles: *mut u32,
    pub num_samples: tsk_size_t,
    pub num_sites: tsk_size_t,
    pub num_nodes: tsk_size_t,
    pub tree: tsk_tree_t,
    pub diffs: tsk_diff_iter_t,
    pub parent: *mut tsk_id_t,
    pub transitions: *mut tsk_value_transition_t,
    pub transitions_copy: *mut tsk_value_transition_t,
    pub transition_stack: *mut tsk_transition_stack_t,
    pub transition_index: *mut tsk_id_t,
    pub transition_time_order: *mut tsk_argsort_t,
    pub num_transitions: tsk_size_t,
    pub max_transitions: tsk_size_t,
    pub values: *mut f64,
    pub num_values: tsk_size_t,
    pub max_values: tsk_size_t,
    pub max_parsimony_words: tsk_size_t,
    pub num_optimal_value_set_words: tsk_size_t,
    pub optimal_value_sets: *mut u64,
    pub transition_parent: *mut tsk_id_t,
    pub num_transition_samples: *mut tsk_size_t,
    pub allelic_state: *mut i32,
    pub next_probability: ::std::option::Option<
        unsafe extern "C" fn(
            arg1: *mut _tsk_ls_hmm_t,
            arg2: tsk_id_t,
            arg3: f64,
            arg4: bool,
            arg5: tsk_id_t,
            arg6: *mut f64,
        ) -> ::std::os::raw::c_int,
    >,
    pub compute_normalisation_factor:
        ::std::option::Option<unsafe extern "C" fn(arg1: *mut _tsk_ls_hmm_t) -> f64>,
    pub output: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout__tsk_ls_hmm_t() {
    const UNINIT: ::std::mem::MaybeUninit<_tsk_ls_hmm_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_tsk_ls_hmm_t>(),
        496usize,
        concat!("Size of: ", stringify!(_tsk_ls_hmm_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_tsk_ls_hmm_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_tsk_ls_hmm_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree_sequence) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(tree_sequence)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).recombination_rate) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(recombination_rate)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).mutation_rate) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(mutation_rate)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).alleles) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(alleles)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).precision) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(precision)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_alleles) as usize - ptr as usize },
        40usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_alleles)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_samples) as usize - ptr as usize },
        48usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_sites) as usize - ptr as usize },
        56usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_sites)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_nodes) as usize - ptr as usize },
        64usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_nodes)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tree) as usize - ptr as usize },
        72usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(tree)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).diffs) as usize - ptr as usize },
        280usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(diffs)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize },
        336usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transitions) as usize - ptr as usize },
        344usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(transitions)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transitions_copy) as usize - ptr as usize },
        352usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(transitions_copy)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transition_stack) as usize - ptr as usize },
        360usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(transition_stack)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transition_index) as usize - ptr as usize },
        368usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(transition_index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transition_time_order) as usize - ptr as usize },
        376usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(transition_time_order)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_transitions) as usize - ptr as usize },
        384usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_transitions)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_transitions) as usize - ptr as usize },
        392usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(max_transitions)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).values) as usize - ptr as usize },
        400usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(values)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_values) as usize - ptr as usize },
        408usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_values)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_values) as usize - ptr as usize },
        416usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(max_values)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).max_parsimony_words) as usize - ptr as usize },
        424usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(max_parsimony_words)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_optimal_value_set_words) as usize - ptr as usize },
        432usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_optimal_value_set_words)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).optimal_value_sets) as usize - ptr as usize },
        440usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(optimal_value_sets)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).transition_parent) as usize - ptr as usize },
        448usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(transition_parent)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).num_transition_samples) as usize - ptr as usize },
        456usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(num_transition_samples)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).allelic_state) as usize - ptr as usize },
        464usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(allelic_state)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).next_probability) as usize - ptr as usize },
        472usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(next_probability)
        )
    );
    assert_eq!(
        unsafe {
            ::std::ptr::addr_of!((*ptr).compute_normalisation_factor) as usize - ptr as usize
        },
        480usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(compute_normalisation_factor)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).output) as usize - ptr as usize },
        488usize,
        concat!(
            "Offset of field: ",
            stringify!(_tsk_ls_hmm_t),
            "::",
            stringify!(output)
        )
    );
}
pub type tsk_ls_hmm_t = _tsk_ls_hmm_t;
extern "C" {
    pub fn tsk_ls_hmm_init(
        self_: *mut tsk_ls_hmm_t,
        tree_sequence: *mut tsk_treeseq_t,
        recombination_rate: *mut f64,
        mutation_rate: *mut f64,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ls_hmm_set_precision(
        self_: *mut tsk_ls_hmm_t,
        precision: ::std::os::raw::c_uint,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ls_hmm_free(self_: *mut tsk_ls_hmm_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ls_hmm_print_state(self_: *mut tsk_ls_hmm_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_ls_hmm_forward(
        self_: *mut tsk_ls_hmm_t,
        haplotype: *mut i32,
        output: *mut tsk_compressed_matrix_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ls_hmm_viterbi(
        self_: *mut tsk_ls_hmm_t,
        haplotype: *mut i32,
        output: *mut tsk_viterbi_matrix_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_ls_hmm_run(
        self_: *mut tsk_ls_hmm_t,
        haplotype: *mut i32,
        next_probability: ::std::option::Option<
            unsafe extern "C" fn(
                arg1: *mut tsk_ls_hmm_t,
                arg2: tsk_id_t,
                arg3: f64,
                arg4: bool,
                arg5: tsk_id_t,
                arg6: *mut f64,
            ) -> ::std::os::raw::c_int,
        >,
        compute_normalisation_factor: ::std::option::Option<
            unsafe extern "C" fn(arg1: *mut _tsk_ls_hmm_t) -> f64,
        >,
        output: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_compressed_matrix_init(
        self_: *mut tsk_compressed_matrix_t,
        tree_sequence: *mut tsk_treeseq_t,
        block_size: tsk_size_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_compressed_matrix_free(self_: *mut tsk_compressed_matrix_t)
        -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_compressed_matrix_clear(
        self_: *mut tsk_compressed_matrix_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_compressed_matrix_print_state(self_: *mut tsk_compressed_matrix_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_compressed_matrix_store_site(
        self_: *mut tsk_compressed_matrix_t,
        site: tsk_id_t,
        normalisation_factor: f64,
        num_transitions: tsk_size_t,
        transitions: *const tsk_value_transition_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_compressed_matrix_decode(
        self_: *mut tsk_compressed_matrix_t,
        values: *mut f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_viterbi_matrix_init(
        self_: *mut tsk_viterbi_matrix_t,
        tree_sequence: *mut tsk_treeseq_t,
        block_size: tsk_size_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_viterbi_matrix_free(self_: *mut tsk_viterbi_matrix_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_viterbi_matrix_clear(self_: *mut tsk_viterbi_matrix_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_viterbi_matrix_print_state(self_: *mut tsk_viterbi_matrix_t, out: *mut FILE);
}
extern "C" {
    pub fn tsk_viterbi_matrix_add_recombination_required(
        self_: *mut tsk_viterbi_matrix_t,
        site: tsk_id_t,
        node: tsk_id_t,
        required: bool,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn tsk_viterbi_matrix_traceback(
        self_: *mut tsk_viterbi_matrix_t,
        path: *mut tsk_id_t,
        options: tsk_flags_t,
    ) -> ::std::os::raw::c_int;
}