[go: up one dir, main page]

zstd-sys 1.4.3+zstd.1.3.4

Low-level bindings for the zstd compression library.
Documentation
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
/* automatically generated by rust-bindgen */

pub const ZSTD_VERSION_MAJOR: u32 = 1;
pub const ZSTD_VERSION_MINOR: u32 = 3;
pub const ZSTD_VERSION_RELEASE: u32 = 4;
pub const ZSTD_VERSION_NUMBER: u32 = 10304;
pub const ZSTD_CONTENTSIZE_UNKNOWN: i32 = -1;
pub const ZSTD_CONTENTSIZE_ERROR: i32 = -2;
pub const ZSTD_MAGICNUMBER: u32 = 4247762216;
pub const ZSTD_MAGIC_SKIPPABLE_START: u32 = 407710288;
pub const ZSTD_MAGIC_DICTIONARY: u32 = 3962610743;
pub const ZSTD_WINDOWLOG_MAX_32: u32 = 30;
pub const ZSTD_WINDOWLOG_MAX_64: u32 = 31;
pub const ZSTD_WINDOWLOG_MIN: u32 = 10;
pub const ZSTD_HASHLOG_MIN: u32 = 6;
pub const ZSTD_CHAINLOG_MAX_32: u32 = 29;
pub const ZSTD_CHAINLOG_MAX_64: u32 = 30;
pub const ZSTD_CHAINLOG_MIN: u32 = 6;
pub const ZSTD_HASHLOG3_MAX: u32 = 17;
pub const ZSTD_SEARCHLOG_MIN: u32 = 1;
pub const ZSTD_SEARCHLENGTH_MAX: u32 = 7;
pub const ZSTD_SEARCHLENGTH_MIN: u32 = 3;
pub const ZSTD_TARGETLENGTH_MIN: u32 = 1;
pub const ZSTD_LDM_MINMATCH_MIN: u32 = 4;
pub const ZSTD_LDM_MINMATCH_MAX: u32 = 4096;
pub const ZSTD_LDM_BUCKETSIZELOG_MAX: u32 = 8;
pub const ZSTD_FRAMEHEADERSIZE_PREFIX: u32 = 5;
pub const ZSTD_FRAMEHEADERSIZE_MIN: u32 = 6;
pub const ZSTD_FRAMEHEADERSIZE_MAX: u32 = 18;
pub const ZSTD_BLOCKSIZELOG_MAX: u32 = 17;
pub const ZSTD_BLOCKSIZE_MAX: u32 = 131072;
pub const ZSTDMT_JOBSIZE_MIN: u32 = 1048576;
pub type wchar_t = ::libc::c_int;
extern "C" {
    pub fn ZSTD_versionNumber() -> ::libc::c_uint;
}
extern "C" {
    pub fn ZSTD_versionString() -> *const ::libc::c_char;
}
extern "C" {
    /// Simple API
    /// /
    /// /*! ZSTD_compress() :
    /// Compresses `src` content as a single zstd compressed frame into already allocated `dst`.
    /// Hint : compression runs faster if `dstCapacity` >=  `ZSTD_compressBound(srcSize)`.
    /// @return : compressed size written into `dst` (<= `dstCapacity),
    /// or an error code if it fails (which can be tested using ZSTD_isError()).
    pub fn ZSTD_compress(
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    /// ZSTD_decompress() :
    /// `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames.
    /// `dstCapacity` is an upper bound of originalSize to regenerate.
    /// If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data.
    /// @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),
    /// or an errorCode if it fails (which can be tested using ZSTD_isError()).
    pub fn ZSTD_decompress(
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        compressedSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_getFrameContentSize(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> ::libc::c_ulonglong;
}
extern "C" {
    /// ZSTD_getDecompressedSize() :
    /// NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize().
    /// Both functions work the same way, but ZSTD_getDecompressedSize() blends
    /// "empty", "unknown" and "error" results to the same return value (0),
    /// while ZSTD_getFrameContentSize() gives them separate return values.
    /// `src` is the start of a zstd compressed frame.
    /// @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise.
    pub fn ZSTD_getDecompressedSize(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> ::libc::c_ulonglong;
}
extern "C" {
    pub fn ZSTD_compressBound(srcSize: usize) -> usize;
}
extern "C" {
    pub fn ZSTD_isError(code: usize) -> ::libc::c_uint;
}
extern "C" {
    pub fn ZSTD_getErrorName(code: usize) -> *const ::libc::c_char;
}
extern "C" {
    pub fn ZSTD_maxCLevel() -> ::libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_CCtx_s {
    _unused: [u8; 0],
}
/// Explicit context
pub type ZSTD_CCtx = ZSTD_CCtx_s;
extern "C" {
    pub fn ZSTD_createCCtx() -> *mut ZSTD_CCtx;
}
extern "C" {
    pub fn ZSTD_freeCCtx(cctx: *mut ZSTD_CCtx) -> usize;
}
extern "C" {
    /// ZSTD_compressCCtx() :
    /// Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()).
    pub fn ZSTD_compressCCtx(
        ctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_DCtx_s {
    _unused: [u8; 0],
}
pub type ZSTD_DCtx = ZSTD_DCtx_s;
extern "C" {
    pub fn ZSTD_createDCtx() -> *mut ZSTD_DCtx;
}
extern "C" {
    pub fn ZSTD_freeDCtx(dctx: *mut ZSTD_DCtx) -> usize;
}
extern "C" {
    /// ZSTD_decompressDCtx() :
    /// Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx())
    pub fn ZSTD_decompressDCtx(
        ctx: *mut ZSTD_DCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    /// Simple dictionary API
    /// /
    /// /*! ZSTD_compress_usingDict() :
    /// Compression using a predefined Dictionary (see dictBuilder/zdict.h).
    /// Note : This function loads the dictionary, resulting in significant startup delay.
    /// Note : When `dict == NULL || dictSize < 8` no dictionary is used.
    pub fn ZSTD_compress_usingDict(
        ctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        dict: *const ::libc::c_void,
        dictSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    /// ZSTD_decompress_usingDict() :
    /// Decompression using a predefined Dictionary (see dictBuilder/zdict.h).
    /// Dictionary must be identical to the one used during compression.
    /// Note : This function loads the dictionary, resulting in significant startup delay.
    /// Note : When `dict == NULL || dictSize < 8` no dictionary is used.
    pub fn ZSTD_decompress_usingDict(
        dctx: *mut ZSTD_DCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_CDict_s {
    _unused: [u8; 0],
}
/// Bulk processing dictionary API
pub type ZSTD_CDict = ZSTD_CDict_s;
extern "C" {
    /// ZSTD_createCDict() :
    /// When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once.
    /// ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay.
    /// ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only.
    /// `dictBuffer` can be released after ZSTD_CDict creation, since its content is copied within CDict
    pub fn ZSTD_createCDict(
        dictBuffer: *const ::libc::c_void,
        dictSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> *mut ZSTD_CDict;
}
extern "C" {
    /// ZSTD_freeCDict() :
    /// Function frees memory allocated by ZSTD_createCDict().
    pub fn ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize;
}
extern "C" {
    /// ZSTD_compress_usingCDict() :
    /// Compression using a digested Dictionary.
    /// Faster startup than ZSTD_compress_usingDict(), recommended when same dictionary is used multiple times.
    /// Note that compression level is decided during dictionary creation.
    /// Frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)
    pub fn ZSTD_compress_usingCDict(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        cdict: *const ZSTD_CDict,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_DDict_s {
    _unused: [u8; 0],
}
pub type ZSTD_DDict = ZSTD_DDict_s;
extern "C" {
    /// ZSTD_createDDict() :
    /// Create a digested dictionary, ready to start decompression operation without startup delay.
    /// dictBuffer can be released after DDict creation, as its content is copied inside DDict
    pub fn ZSTD_createDDict(
        dictBuffer: *const ::libc::c_void,
        dictSize: usize,
    ) -> *mut ZSTD_DDict;
}
extern "C" {
    /// ZSTD_freeDDict() :
    /// Function frees memory allocated with ZSTD_createDDict()
    pub fn ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize;
}
extern "C" {
    /// ZSTD_decompress_usingDDict() :
    /// Decompression using a digested Dictionary.
    /// Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times.
    pub fn ZSTD_decompress_usingDDict(
        dctx: *mut ZSTD_DCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        ddict: *const ZSTD_DDict,
    ) -> usize;
}
/// Streaming
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_inBuffer_s {
    /// < start of input buffer
    pub src: *const ::libc::c_void,
    /// < size of input buffer
    pub size: usize,
    /// < position where reading stopped. Will be updated. Necessarily 0 <= pos <= size
    pub pos: usize,
}
#[test]
fn bindgen_test_layout_ZSTD_inBuffer_s() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_inBuffer_s>(),
        24usize,
        concat!("Size of: ", stringify!(ZSTD_inBuffer_s))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_inBuffer_s>(),
        8usize,
        concat!("Alignment of ", stringify!(ZSTD_inBuffer_s))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).src as *const _
                as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_inBuffer_s),
            "::",
            stringify!(src)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).size as *const _
                as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_inBuffer_s),
            "::",
            stringify!(size)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_inBuffer_s>())).pos as *const _
                as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_inBuffer_s),
            "::",
            stringify!(pos)
        )
    );
}
pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_outBuffer_s {
    /// < start of output buffer
    pub dst: *mut ::libc::c_void,
    /// < size of output buffer
    pub size: usize,
    /// < position where writing stopped. Will be updated. Necessarily 0 <= pos <= size
    pub pos: usize,
}
#[test]
fn bindgen_test_layout_ZSTD_outBuffer_s() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_outBuffer_s>(),
        24usize,
        concat!("Size of: ", stringify!(ZSTD_outBuffer_s))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_outBuffer_s>(),
        8usize,
        concat!("Alignment of ", stringify!(ZSTD_outBuffer_s))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).dst as *const _
                as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_outBuffer_s),
            "::",
            stringify!(dst)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).size as *const _
                as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_outBuffer_s),
            "::",
            stringify!(size)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_outBuffer_s>())).pos as *const _
                as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_outBuffer_s),
            "::",
            stringify!(pos)
        )
    );
}
pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
pub type ZSTD_CStream = ZSTD_CCtx;
extern "C" {
    pub fn ZSTD_createCStream() -> *mut ZSTD_CStream;
}
extern "C" {
    pub fn ZSTD_freeCStream(zcs: *mut ZSTD_CStream) -> usize;
}
extern "C" {
    pub fn ZSTD_initCStream(
        zcs: *mut ZSTD_CStream,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressStream(
        zcs: *mut ZSTD_CStream,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_flushStream(
        zcs: *mut ZSTD_CStream,
        output: *mut ZSTD_outBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_endStream(
        zcs: *mut ZSTD_CStream,
        output: *mut ZSTD_outBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_CStreamInSize() -> usize;
}
extern "C" {
    pub fn ZSTD_CStreamOutSize() -> usize;
}
pub type ZSTD_DStream = ZSTD_DCtx;
extern "C" {
    pub fn ZSTD_createDStream() -> *mut ZSTD_DStream;
}
extern "C" {
    pub fn ZSTD_freeDStream(zds: *mut ZSTD_DStream) -> usize;
}
extern "C" {
    pub fn ZSTD_initDStream(zds: *mut ZSTD_DStream) -> usize;
}
extern "C" {
    pub fn ZSTD_decompressStream(
        zds: *mut ZSTD_DStream,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_DStreamInSize() -> usize;
}
extern "C" {
    pub fn ZSTD_DStreamOutSize() -> usize;
}
pub const ZSTD_frameHeaderSize_prefix: usize = 5;
pub const ZSTD_frameHeaderSize_min: usize = 6;
pub const ZSTD_frameHeaderSize_max: usize = 18;
pub const ZSTD_skippableHeaderSize: usize = 8;
pub const ZSTD_strategy_ZSTD_fast: ZSTD_strategy = 1;
pub const ZSTD_strategy_ZSTD_dfast: ZSTD_strategy = 2;
pub const ZSTD_strategy_ZSTD_greedy: ZSTD_strategy = 3;
pub const ZSTD_strategy_ZSTD_lazy: ZSTD_strategy = 4;
pub const ZSTD_strategy_ZSTD_lazy2: ZSTD_strategy = 5;
pub const ZSTD_strategy_ZSTD_btlazy2: ZSTD_strategy = 6;
pub const ZSTD_strategy_ZSTD_btopt: ZSTD_strategy = 7;
pub const ZSTD_strategy_ZSTD_btultra: ZSTD_strategy = 8;
pub type ZSTD_strategy = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_compressionParameters {
    /// < largest match distance : larger == more compression, more memory needed during decompression
    pub windowLog: ::libc::c_uint,
    /// < fully searched segment : larger == more compression, slower, more memory (useless for fast)
    pub chainLog: ::libc::c_uint,
    /// < dispatch table : larger == faster, more memory
    pub hashLog: ::libc::c_uint,
    /// < nb of searches : larger == more compression, slower
    pub searchLog: ::libc::c_uint,
    /// < match length searched : larger == faster decompression, sometimes less compression
    pub searchLength: ::libc::c_uint,
    /// < acceptable match size for optimal parser (only) : larger == more compression, slower
    pub targetLength: ::libc::c_uint,
    pub strategy: ZSTD_strategy,
}
#[test]
fn bindgen_test_layout_ZSTD_compressionParameters() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_compressionParameters>(),
        28usize,
        concat!("Size of: ", stringify!(ZSTD_compressionParameters))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_compressionParameters>(),
        4usize,
        concat!("Alignment of ", stringify!(ZSTD_compressionParameters))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>())).windowLog
                as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(windowLog)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>())).chainLog
                as *const _ as usize
        },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(chainLog)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>())).hashLog
                as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(hashLog)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>())).searchLog
                as *const _ as usize
        },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(searchLog)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>()))
                .searchLength as *const _ as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(searchLength)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>()))
                .targetLength as *const _ as usize
        },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(targetLength)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_compressionParameters>())).strategy
                as *const _ as usize
        },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_compressionParameters),
            "::",
            stringify!(strategy)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_frameParameters {
    /// < 1: content size will be in frame header (when known)
    pub contentSizeFlag: ::libc::c_uint,
    /// < 1: generate a 32-bits checksum at end of frame, for error detection
    pub checksumFlag: ::libc::c_uint,
    /// < 1: no dictID will be saved into frame header (if dictionary compression)
    pub noDictIDFlag: ::libc::c_uint,
}
#[test]
fn bindgen_test_layout_ZSTD_frameParameters() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_frameParameters>(),
        12usize,
        concat!("Size of: ", stringify!(ZSTD_frameParameters))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_frameParameters>(),
        4usize,
        concat!("Alignment of ", stringify!(ZSTD_frameParameters))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameParameters>())).contentSizeFlag
                as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameParameters),
            "::",
            stringify!(contentSizeFlag)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameParameters>())).checksumFlag
                as *const _ as usize
        },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameParameters),
            "::",
            stringify!(checksumFlag)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameParameters>())).noDictIDFlag
                as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameParameters),
            "::",
            stringify!(noDictIDFlag)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_parameters {
    pub cParams: ZSTD_compressionParameters,
    pub fParams: ZSTD_frameParameters,
}
#[test]
fn bindgen_test_layout_ZSTD_parameters() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_parameters>(),
        40usize,
        concat!("Size of: ", stringify!(ZSTD_parameters))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_parameters>(),
        4usize,
        concat!("Alignment of ", stringify!(ZSTD_parameters))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_parameters>())).cParams as *const _
                as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_parameters),
            "::",
            stringify!(cParams)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_parameters>())).fParams as *const _
                as usize
        },
        28usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_parameters),
            "::",
            stringify!(fParams)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_CCtx_params_s {
    _unused: [u8; 0],
}
pub type ZSTD_CCtx_params = ZSTD_CCtx_params_s;
pub const ZSTD_dictContentType_e_ZSTD_dct_auto: ZSTD_dictContentType_e = 0;
pub const ZSTD_dictContentType_e_ZSTD_dct_rawContent: ZSTD_dictContentType_e =
    1;
pub const ZSTD_dictContentType_e_ZSTD_dct_fullDict: ZSTD_dictContentType_e = 2;
pub type ZSTD_dictContentType_e = u32;
/// < Copy dictionary content internally
pub const ZSTD_dictLoadMethod_e_ZSTD_dlm_byCopy: ZSTD_dictLoadMethod_e = 0;
/// < Reference dictionary content -- the dictionary buffer must outlive its users.
pub const ZSTD_dictLoadMethod_e_ZSTD_dlm_byRef: ZSTD_dictLoadMethod_e = 1;
pub type ZSTD_dictLoadMethod_e = u32;
extern "C" {
    /// ZSTD_findFrameCompressedSize() :
    /// `src` should point to the start of a ZSTD encoded frame or skippable frame
    /// `srcSize` must be >= first frame size
    /// @return : the compressed size of the first frame starting at `src`,
    /// suitable to pass to `ZSTD_decompress` or similar,
    /// or an error code if input is invalid
    pub fn ZSTD_findFrameCompressedSize(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    /// ZSTD_findDecompressedSize() :
    /// `src` should point the start of a series of ZSTD encoded and/or skippable frames
    /// `srcSize` must be the _exact_ size of this series
    /// (i.e. there should be a frame boundary exactly at `srcSize` bytes after `src`)
    /// @return : - decompressed size of all data in all successive frames
    /// - if the decompressed size cannot be determined: ZSTD_CONTENTSIZE_UNKNOWN
    /// - if an error occurred: ZSTD_CONTENTSIZE_ERROR
    ///
    /// note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode.
    /// When `return==ZSTD_CONTENTSIZE_UNKNOWN`, data to decompress could be any size.
    /// In which case, it's necessary to use streaming mode to decompress data.
    /// note 2 : decompressed size is always present when compression is done with ZSTD_compress()
    /// note 3 : decompressed size can be very large (64-bits value),
    /// potentially larger than what local system can handle as a single memory segment.
    /// In which case, it's necessary to use streaming mode to decompress data.
    /// note 4 : If source is untrusted, decompressed size could be wrong or intentionally modified.
    /// Always ensure result fits within application's authorized limits.
    /// Each application can set its own limits.
    /// note 5 : ZSTD_findDecompressedSize handles multiple frames, and so it must traverse the input to
    /// read each contained frame header.  This is fast as most of the data is skipped,
    /// however it does mean that all frame data must be present and valid.
    pub fn ZSTD_findDecompressedSize(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> ::libc::c_ulonglong;
}
extern "C" {
    /// ZSTD_frameHeaderSize() :
    /// `src` should point to the start of a ZSTD frame
    /// `srcSize` must be >= ZSTD_frameHeaderSize_prefix.
    /// @return : size of the Frame Header
    pub fn ZSTD_frameHeaderSize(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    /// ZSTD_sizeof_*() :
    /// These functions give the current memory usage of selected object.
    /// Object memory usage can evolve when re-used.
    pub fn ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize;
}
extern "C" {
    pub fn ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize;
}
extern "C" {
    pub fn ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize;
}
extern "C" {
    pub fn ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize;
}
extern "C" {
    pub fn ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize;
}
extern "C" {
    pub fn ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize;
}
extern "C" {
    /// ZSTD_estimate*() :
    /// These functions make it possible to estimate memory usage
    /// of a future {D,C}Ctx, before its creation.
    /// ZSTD_estimateCCtxSize() will provide a budget large enough for any compression level up to selected one.
    /// It will also consider src size to be arbitrarily "large", which is worst case.
    /// If srcSize is known to always be small, ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation.
    /// ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
    /// ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbWorkers is >= 1.
    /// Note : CCtx size estimation is only correct for single-threaded compression.
    pub fn ZSTD_estimateCCtxSize(compressionLevel: ::libc::c_int) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateCCtxSize_usingCParams(
        cParams: ZSTD_compressionParameters,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateCCtxSize_usingCCtxParams(
        params: *const ZSTD_CCtx_params,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateDCtxSize() -> usize;
}
extern "C" {
    /// ZSTD_estimateCStreamSize() :
    /// ZSTD_estimateCStreamSize() will provide a budget large enough for any compression level up to selected one.
    /// It will also consider src size to be arbitrarily "large", which is worst case.
    /// If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation.
    /// ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
    /// ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbWorkers is >= 1.
    /// Note : CStream size estimation is only correct for single-threaded compression.
    /// ZSTD_DStream memory budget depends on window Size.
    /// This information can be passed manually, using ZSTD_estimateDStreamSize,
    /// or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();
    /// Note : if streaming is init with function ZSTD_init?Stream_usingDict(),
    /// an internal ?Dict will be created, which additional size is not estimated here.
    /// In this case, get total size by adding ZSTD_estimate?DictSize
    pub fn ZSTD_estimateCStreamSize(compressionLevel: ::libc::c_int) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateCStreamSize_usingCParams(
        cParams: ZSTD_compressionParameters,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateCStreamSize_usingCCtxParams(
        params: *const ZSTD_CCtx_params,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateDStreamSize(windowSize: usize) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateDStreamSize_fromFrame(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    /// ZSTD_estimate?DictSize() :
    /// ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict().
    /// ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced().
    /// Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller.
    pub fn ZSTD_estimateCDictSize(
        dictSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateCDictSize_advanced(
        dictSize: usize,
        cParams: ZSTD_compressionParameters,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_estimateDDictSize(
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
    ) -> usize;
}
extern "C" {
    /// ZSTD_initStatic*() :
    /// Initialize an object using a pre-allocated fixed-size buffer.
    /// workspace: The memory area to emplace the object into.
    /// Provided pointer *must be 8-bytes aligned*.
    /// Buffer must outlive object.
    /// workspaceSize: Use ZSTD_estimate*Size() to determine
    /// how large workspace must be to support target scenario.
    /// @return : pointer to object (same address as workspace, just different type),
    /// or NULL if error (size too small, incorrect alignment, etc.)
    /// Note : zstd will never resize nor malloc() when using a static buffer.
    /// If the object requires more memory than available,
    /// zstd will just error out (typically ZSTD_error_memory_allocation).
    /// Note 2 : there is no corresponding "free" function.
    /// Since workspace is allocated externally, it must be freed externally too.
    /// Note 3 : cParams : use ZSTD_getCParams() to convert a compression level
    /// into its associated cParams.
    /// Limitation 1 : currently not compatible with internal dictionary creation, triggered by
    /// ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict().
    /// Limitation 2 : static cctx currently not compatible with multi-threading.
    /// Limitation 3 : static dctx is incompatible with legacy support.
    pub fn ZSTD_initStaticCCtx(
        workspace: *mut ::libc::c_void,
        workspaceSize: usize,
    ) -> *mut ZSTD_CCtx;
}
extern "C" {
    pub fn ZSTD_initStaticCStream(
        workspace: *mut ::libc::c_void,
        workspaceSize: usize,
    ) -> *mut ZSTD_CStream;
}
extern "C" {
    pub fn ZSTD_initStaticDCtx(
        workspace: *mut ::libc::c_void,
        workspaceSize: usize,
    ) -> *mut ZSTD_DCtx;
}
extern "C" {
    pub fn ZSTD_initStaticDStream(
        workspace: *mut ::libc::c_void,
        workspaceSize: usize,
    ) -> *mut ZSTD_DStream;
}
extern "C" {
    pub fn ZSTD_initStaticCDict(
        workspace: *mut ::libc::c_void,
        workspaceSize: usize,
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
        dictContentType: ZSTD_dictContentType_e,
        cParams: ZSTD_compressionParameters,
    ) -> *const ZSTD_CDict;
}
extern "C" {
    pub fn ZSTD_initStaticDDict(
        workspace: *mut ::libc::c_void,
        workspaceSize: usize,
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
        dictContentType: ZSTD_dictContentType_e,
    ) -> *const ZSTD_DDict;
}
/// Custom memory allocation :
/// These prototypes make it possible to pass your own allocation/free functions.
/// ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below.
/// All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones.
pub type ZSTD_allocFunction = ::core::option::Option<
    unsafe extern "C" fn(opaque: *mut ::libc::c_void, size: usize)
        -> *mut ::libc::c_void,
>;
pub type ZSTD_freeFunction = ::core::option::Option<
    unsafe extern "C" fn(
        opaque: *mut ::libc::c_void,
        address: *mut ::libc::c_void,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_customMem {
    pub customAlloc: ZSTD_allocFunction,
    pub customFree: ZSTD_freeFunction,
    pub opaque: *mut ::libc::c_void,
}
#[test]
fn bindgen_test_layout_ZSTD_customMem() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_customMem>(),
        24usize,
        concat!("Size of: ", stringify!(ZSTD_customMem))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_customMem>(),
        8usize,
        concat!("Alignment of ", stringify!(ZSTD_customMem))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_customMem>())).customAlloc as *const _
                as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_customMem),
            "::",
            stringify!(customAlloc)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_customMem>())).customFree as *const _
                as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_customMem),
            "::",
            stringify!(customFree)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_customMem>())).opaque as *const _
                as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_customMem),
            "::",
            stringify!(opaque)
        )
    );
}
extern "C" {
    #[link_name = "\u{1}ZSTD_defaultCMem"]
    pub static mut ZSTD_defaultCMem: ZSTD_customMem;
}
extern "C" {
    pub fn ZSTD_createCCtx_advanced(
        customMem: ZSTD_customMem,
    ) -> *mut ZSTD_CCtx;
}
extern "C" {
    pub fn ZSTD_createCStream_advanced(
        customMem: ZSTD_customMem,
    ) -> *mut ZSTD_CStream;
}
extern "C" {
    pub fn ZSTD_createDCtx_advanced(
        customMem: ZSTD_customMem,
    ) -> *mut ZSTD_DCtx;
}
extern "C" {
    pub fn ZSTD_createDStream_advanced(
        customMem: ZSTD_customMem,
    ) -> *mut ZSTD_DStream;
}
extern "C" {
    pub fn ZSTD_createCDict_advanced(
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
        dictContentType: ZSTD_dictContentType_e,
        cParams: ZSTD_compressionParameters,
        customMem: ZSTD_customMem,
    ) -> *mut ZSTD_CDict;
}
extern "C" {
    pub fn ZSTD_createDDict_advanced(
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
        dictContentType: ZSTD_dictContentType_e,
        customMem: ZSTD_customMem,
    ) -> *mut ZSTD_DDict;
}
extern "C" {
    /// ZSTD_createCDict_byReference() :
    /// Create a digested dictionary for compression
    /// Dictionary content is simply referenced, and therefore stays in dictBuffer.
    /// It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict
    pub fn ZSTD_createCDict_byReference(
        dictBuffer: *const ::libc::c_void,
        dictSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> *mut ZSTD_CDict;
}
extern "C" {
    /// ZSTD_getCParams() :
    /// @return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize.
    /// `estimatedSrcSize` value is optional, select 0 if not known
    pub fn ZSTD_getCParams(
        compressionLevel: ::libc::c_int,
        estimatedSrcSize: ::libc::c_ulonglong,
        dictSize: usize,
    ) -> ZSTD_compressionParameters;
}
extern "C" {
    /// ZSTD_getParams() :
    /// same as ZSTD_getCParams(), but @return a full `ZSTD_parameters` object instead of sub-component `ZSTD_compressionParameters`.
    /// All fields of `ZSTD_frameParameters` are set to default : contentSize=1, checksum=0, noDictID=0
    pub fn ZSTD_getParams(
        compressionLevel: ::libc::c_int,
        estimatedSrcSize: ::libc::c_ulonglong,
        dictSize: usize,
    ) -> ZSTD_parameters;
}
extern "C" {
    /// ZSTD_checkCParams() :
    /// Ensure param values remain within authorized range
    pub fn ZSTD_checkCParams(params: ZSTD_compressionParameters) -> usize;
}
extern "C" {
    /// ZSTD_adjustCParams() :
    /// optimize params for a given `srcSize` and `dictSize`.
    /// both values are optional, select `0` if unknown.
    pub fn ZSTD_adjustCParams(
        cPar: ZSTD_compressionParameters,
        srcSize: ::libc::c_ulonglong,
        dictSize: usize,
    ) -> ZSTD_compressionParameters;
}
extern "C" {
    /// ZSTD_compress_advanced() :
    /// Same as ZSTD_compress_usingDict(), with fine-tune control over each compression parameter
    pub fn ZSTD_compress_advanced(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        dict: *const ::libc::c_void,
        dictSize: usize,
        params: ZSTD_parameters,
    ) -> usize;
}
extern "C" {
    /// ZSTD_compress_usingCDict_advanced() :
    /// Same as ZSTD_compress_usingCDict(), with fine-tune control over frame parameters
    pub fn ZSTD_compress_usingCDict_advanced(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        cdict: *const ZSTD_CDict,
        fParams: ZSTD_frameParameters,
    ) -> usize;
}
extern "C" {
    /// ZSTD_isFrame() :
    /// Tells if the content of `buffer` starts with a valid Frame Identifier.
    /// Note : Frame Identifier is 4 bytes. If `size < 4`, @return will always be 0.
    /// Note 2 : Legacy Frame Identifiers are considered valid only if Legacy Support is enabled.
    /// Note 3 : Skippable Frame Identifiers are considered valid.
    pub fn ZSTD_isFrame(
        buffer: *const ::libc::c_void,
        size: usize,
    ) -> ::libc::c_uint;
}
extern "C" {
    /// ZSTD_createDDict_byReference() :
    /// Create a digested dictionary, ready to start decompression operation without startup delay.
    /// Dictionary content is referenced, and therefore stays in dictBuffer.
    /// It is important that dictBuffer outlives DDict,
    /// it must remain read accessible throughout the lifetime of DDict
    pub fn ZSTD_createDDict_byReference(
        dictBuffer: *const ::libc::c_void,
        dictSize: usize,
    ) -> *mut ZSTD_DDict;
}
extern "C" {
    /// ZSTD_getDictID_fromDict() :
    /// Provides the dictID stored within dictionary.
    /// if @return == 0, the dictionary is not conformant with Zstandard specification.
    /// It can still be loaded, but as a content-only dictionary.
    pub fn ZSTD_getDictID_fromDict(
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> ::libc::c_uint;
}
extern "C" {
    /// ZSTD_getDictID_fromDDict() :
    /// Provides the dictID of the dictionary loaded into `ddict`.
    /// If @return == 0, the dictionary is not conformant to Zstandard specification, or empty.
    /// Non-conformant dictionaries can still be loaded, but as content-only dictionaries.
    pub fn ZSTD_getDictID_fromDDict(
        ddict: *const ZSTD_DDict,
    ) -> ::libc::c_uint;
}
extern "C" {
    /// ZSTD_getDictID_fromFrame() :
    /// Provides the dictID required to decompressed the frame stored within `src`.
    /// If @return == 0, the dictID could not be decoded.
    /// This could for one of the following reasons :
    /// - The frame does not require a dictionary to be decoded (most common case).
    /// - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information.
    /// Note : this use case also happens when using a non-conformant dictionary.
    /// - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`).
    /// - This is not a Zstandard frame.
    /// When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.
    pub fn ZSTD_getDictID_fromFrame(
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> ::libc::c_uint;
}
extern "C" {
    /// Advanced streaming functions
    pub fn ZSTD_initCStream_srcSize(
        zcs: *mut ZSTD_CStream,
        compressionLevel: ::libc::c_int,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_initCStream_usingDict(
        zcs: *mut ZSTD_CStream,
        dict: *const ::libc::c_void,
        dictSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_initCStream_advanced(
        zcs: *mut ZSTD_CStream,
        dict: *const ::libc::c_void,
        dictSize: usize,
        params: ZSTD_parameters,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_initCStream_usingCDict(
        zcs: *mut ZSTD_CStream,
        cdict: *const ZSTD_CDict,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_initCStream_usingCDict_advanced(
        zcs: *mut ZSTD_CStream,
        cdict: *const ZSTD_CDict,
        fParams: ZSTD_frameParameters,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    /// ZSTD_resetCStream() :
    /// start a new compression job, using same parameters from previous job.
    /// This is typically useful to skip dictionary loading stage, since it will re-use it in-place..
    /// Note that zcs must be init at least once before using ZSTD_resetCStream().
    /// If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN.
    /// If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end.
    /// For the time being, pledgedSrcSize==0 is interpreted as "srcSize unknown" for compatibility with older programs,
    /// but it will change to mean "empty" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead.
    /// @return : 0, or an error code (which can be tested using ZSTD_isError())
    pub fn ZSTD_resetCStream(
        zcs: *mut ZSTD_CStream,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_frameProgression {
    pub ingested: ::libc::c_ulonglong,
    pub consumed: ::libc::c_ulonglong,
    pub produced: ::libc::c_ulonglong,
}
#[test]
fn bindgen_test_layout_ZSTD_frameProgression() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_frameProgression>(),
        24usize,
        concat!("Size of: ", stringify!(ZSTD_frameProgression))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_frameProgression>(),
        8usize,
        concat!("Alignment of ", stringify!(ZSTD_frameProgression))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameProgression>())).ingested
                as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameProgression),
            "::",
            stringify!(ingested)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameProgression>())).consumed
                as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameProgression),
            "::",
            stringify!(consumed)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameProgression>())).produced
                as *const _ as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameProgression),
            "::",
            stringify!(produced)
        )
    );
}
extern "C" {
    pub fn ZSTD_getFrameProgression(
        cctx: *const ZSTD_CCtx,
    ) -> ZSTD_frameProgression;
}
pub const ZSTD_DStreamParameter_e_DStream_p_maxWindowSize:
    ZSTD_DStreamParameter_e = 0;
pub type ZSTD_DStreamParameter_e = u32;
extern "C" {
    pub fn ZSTD_setDStreamParameter(
        zds: *mut ZSTD_DStream,
        paramType: ZSTD_DStreamParameter_e,
        paramValue: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_initDStream_usingDict(
        zds: *mut ZSTD_DStream,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_initDStream_usingDDict(
        zds: *mut ZSTD_DStream,
        ddict: *const ZSTD_DDict,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_resetDStream(zds: *mut ZSTD_DStream) -> usize;
}
extern "C" {
    /// Buffer-less streaming compression (synchronous mode)
    ///
    /// A ZSTD_CCtx object is required to track streaming operations.
    /// Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
    /// ZSTD_CCtx object can be re-used multiple times within successive compression operations.
    ///
    /// Start by initializing a context.
    /// Use ZSTD_compressBegin(), or ZSTD_compressBegin_usingDict() for dictionary compression,
    /// or ZSTD_compressBegin_advanced(), for finer parameter control.
    /// It's also possible to duplicate a reference context which has already been initialized, using ZSTD_copyCCtx()
    ///
    /// Then, consume your input using ZSTD_compressContinue().
    /// There are some important considerations to keep in mind when using this advanced function :
    /// - ZSTD_compressContinue() has no internal buffer. It uses externally provided buffers only.
    /// - Interface is synchronous : input is consumed entirely and produces 1+ compressed blocks.
    /// - Caller must ensure there is enough space in `dst` to store compressed data under worst case scenario.
    /// Worst case evaluation is provided by ZSTD_compressBound().
    /// ZSTD_compressContinue() doesn't guarantee recover after a failed compression.
    /// - ZSTD_compressContinue() presumes prior input ***is still accessible and unmodified*** (up to maximum distance size, see WindowLog).
    /// It remembers all previous contiguous blocks, plus one separated memory segment (which can itself consists of multiple contiguous blocks)
    /// - ZSTD_compressContinue() detects that prior input has been overwritten when `src` buffer overlaps.
    /// In which case, it will "discard" the relevant memory section from its history.
    ///
    /// Finish a frame with ZSTD_compressEnd(), which will write the last block(s) and optional checksum.
    /// It's possible to use srcSize==0, in which case, it will write a final empty block to end the frame.
    /// Without last block mark, frames are considered unfinished (hence corrupted) by compliant decoders.
    ///
    /// `ZSTD_CCtx` object can be re-used (ZSTD_compressBegin()) to compress again.
    pub fn ZSTD_compressBegin(
        cctx: *mut ZSTD_CCtx,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressBegin_usingDict(
        cctx: *mut ZSTD_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressBegin_advanced(
        cctx: *mut ZSTD_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
        params: ZSTD_parameters,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressBegin_usingCDict(
        cctx: *mut ZSTD_CCtx,
        cdict: *const ZSTD_CDict,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressBegin_usingCDict_advanced(
        cctx: *const ZSTD_CCtx,
        cdict: *const ZSTD_CDict,
        fParams: ZSTD_frameParameters,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_copyCCtx(
        cctx: *mut ZSTD_CCtx,
        preparedCCtx: *const ZSTD_CCtx,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressContinue(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_compressEnd(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
pub const ZSTD_frameType_e_ZSTD_frame: ZSTD_frameType_e = 0;
pub const ZSTD_frameType_e_ZSTD_skippableFrame: ZSTD_frameType_e = 1;
pub type ZSTD_frameType_e = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_frameHeader {
    pub frameContentSize: ::libc::c_ulonglong,
    pub windowSize: ::libc::c_ulonglong,
    pub blockSizeMax: ::libc::c_uint,
    pub frameType: ZSTD_frameType_e,
    pub headerSize: ::libc::c_uint,
    pub dictID: ::libc::c_uint,
    pub checksumFlag: ::libc::c_uint,
}
#[test]
fn bindgen_test_layout_ZSTD_frameHeader() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_frameHeader>(),
        40usize,
        concat!("Size of: ", stringify!(ZSTD_frameHeader))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_frameHeader>(),
        8usize,
        concat!("Alignment of ", stringify!(ZSTD_frameHeader))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).frameContentSize
                as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(frameContentSize)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).windowSize
                as *const _ as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(windowSize)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).blockSizeMax
                as *const _ as usize
        },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(blockSizeMax)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).frameType as *const _
                as usize
        },
        20usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(frameType)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).headerSize
                as *const _ as usize
        },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(headerSize)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).dictID as *const _
                as usize
        },
        28usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(dictID)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_frameHeader>())).checksumFlag
                as *const _ as usize
        },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_frameHeader),
            "::",
            stringify!(checksumFlag)
        )
    );
}
extern "C" {
    pub fn ZSTD_getFrameHeader(
        zfhPtr: *mut ZSTD_frameHeader,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_decodingBufferSize_min(
        windowSize: ::libc::c_ulonglong,
        frameContentSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_decompressBegin(dctx: *mut ZSTD_DCtx) -> usize;
}
extern "C" {
    pub fn ZSTD_decompressBegin_usingDict(
        dctx: *mut ZSTD_DCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_decompressBegin_usingDDict(
        dctx: *mut ZSTD_DCtx,
        ddict: *const ZSTD_DDict,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_nextSrcSizeToDecompress(dctx: *mut ZSTD_DCtx) -> usize;
}
extern "C" {
    pub fn ZSTD_decompressContinue(
        dctx: *mut ZSTD_DCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_copyDCtx(dctx: *mut ZSTD_DCtx, preparedDCtx: *const ZSTD_DCtx);
}
pub const ZSTD_nextInputType_e_ZSTDnit_frameHeader: ZSTD_nextInputType_e = 0;
pub const ZSTD_nextInputType_e_ZSTDnit_blockHeader: ZSTD_nextInputType_e = 1;
pub const ZSTD_nextInputType_e_ZSTDnit_block: ZSTD_nextInputType_e = 2;
pub const ZSTD_nextInputType_e_ZSTDnit_lastBlock: ZSTD_nextInputType_e = 3;
pub const ZSTD_nextInputType_e_ZSTDnit_checksum: ZSTD_nextInputType_e = 4;
pub const ZSTD_nextInputType_e_ZSTDnit_skippableFrame: ZSTD_nextInputType_e =
    5;
pub type ZSTD_nextInputType_e = u32;
extern "C" {
    pub fn ZSTD_nextInputType(dctx: *mut ZSTD_DCtx) -> ZSTD_nextInputType_e;
}
pub const ZSTD_format_e_ZSTD_f_zstd1: ZSTD_format_e = 0;
pub const ZSTD_format_e_ZSTD_f_zstd1_magicless: ZSTD_format_e = 1;
/// New advanced API (experimental)
pub type ZSTD_format_e = u32;
pub const ZSTD_cParameter_ZSTD_p_format: ZSTD_cParameter = 10;
pub const ZSTD_cParameter_ZSTD_p_compressionLevel: ZSTD_cParameter = 100;
pub const ZSTD_cParameter_ZSTD_p_windowLog: ZSTD_cParameter = 101;
pub const ZSTD_cParameter_ZSTD_p_hashLog: ZSTD_cParameter = 102;
pub const ZSTD_cParameter_ZSTD_p_chainLog: ZSTD_cParameter = 103;
pub const ZSTD_cParameter_ZSTD_p_searchLog: ZSTD_cParameter = 104;
pub const ZSTD_cParameter_ZSTD_p_minMatch: ZSTD_cParameter = 105;
pub const ZSTD_cParameter_ZSTD_p_targetLength: ZSTD_cParameter = 106;
pub const ZSTD_cParameter_ZSTD_p_compressionStrategy: ZSTD_cParameter = 107;
pub const ZSTD_cParameter_ZSTD_p_enableLongDistanceMatching: ZSTD_cParameter =
    160;
pub const ZSTD_cParameter_ZSTD_p_ldmHashLog: ZSTD_cParameter = 161;
pub const ZSTD_cParameter_ZSTD_p_ldmMinMatch: ZSTD_cParameter = 162;
pub const ZSTD_cParameter_ZSTD_p_ldmBucketSizeLog: ZSTD_cParameter = 163;
pub const ZSTD_cParameter_ZSTD_p_ldmHashEveryLog: ZSTD_cParameter = 164;
pub const ZSTD_cParameter_ZSTD_p_contentSizeFlag: ZSTD_cParameter = 200;
pub const ZSTD_cParameter_ZSTD_p_checksumFlag: ZSTD_cParameter = 201;
pub const ZSTD_cParameter_ZSTD_p_dictIDFlag: ZSTD_cParameter = 202;
pub const ZSTD_cParameter_ZSTD_p_nbWorkers: ZSTD_cParameter = 400;
pub const ZSTD_cParameter_ZSTD_p_jobSize: ZSTD_cParameter = 401;
pub const ZSTD_cParameter_ZSTD_p_overlapSizeLog: ZSTD_cParameter = 402;
pub const ZSTD_cParameter_ZSTD_p_compressLiterals: ZSTD_cParameter = 1000;
pub const ZSTD_cParameter_ZSTD_p_forceMaxWindow: ZSTD_cParameter = 1100;
pub type ZSTD_cParameter = u32;
extern "C" {
    /// ZSTD_CCtx_setParameter() :
    /// Set one compression parameter, selected by enum ZSTD_cParameter.
    /// Setting a parameter is generally only possible during frame initialization (before starting compression),
    /// except for a few exceptions which can be updated during compression: compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy.
    /// Note : when `value` is an enum, cast it to unsigned for proper type checking.
    /// @result : informational value (typically, value being set clamped correctly),
    /// or an error code (which can be tested with ZSTD_isError()).
    pub fn ZSTD_CCtx_setParameter(
        cctx: *mut ZSTD_CCtx,
        param: ZSTD_cParameter,
        value: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_setPledgedSrcSize() :
    /// Total input data size to be compressed as a single frame.
    /// This value will be controlled at the end, and result in error if not respected.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Note 1 : 0 means zero, empty.
    /// In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN.
    /// ZSTD_CONTENTSIZE_UNKNOWN is default value for any new compression job.
    /// Note 2 : If all data is provided and consumed in a single round,
    /// this value is overriden by srcSize instead.
    pub fn ZSTD_CCtx_setPledgedSrcSize(
        cctx: *mut ZSTD_CCtx,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_loadDictionary() :
    /// Create an internal CDict from `dict` buffer.
    /// Decompression will have to use same dictionary.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Special: Adding a NULL (or 0-size) dictionary invalidates previous dictionary,
    /// meaning "return to no-dictionary mode".
    /// Note 1 : Dictionary will be used for all future compression jobs.
    /// To return to "no-dictionary" situation, load a NULL dictionary
    /// Note 2 : Loading a dictionary involves building tables, which are dependent on compression parameters.
    /// For this reason, compression parameters cannot be changed anymore after loading a dictionary.
    /// It's also a CPU consuming operation, with non-negligible impact on latency.
    /// Note 3 :`dict` content will be copied internally.
    /// Use ZSTD_CCtx_loadDictionary_byReference() to reference dictionary content instead.
    /// In such a case, dictionary buffer must outlive its users.
    /// Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()
    /// to precisely select how dictionary content must be interpreted.
    pub fn ZSTD_CCtx_loadDictionary(
        cctx: *mut ZSTD_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_CCtx_loadDictionary_byReference(
        cctx: *mut ZSTD_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_CCtx_loadDictionary_advanced(
        cctx: *mut ZSTD_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
        dictContentType: ZSTD_dictContentType_e,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_refCDict() :
    /// Reference a prepared dictionary, to be used for all next compression jobs.
    /// Note that compression parameters are enforced from within CDict,
    /// and supercede any compression parameter previously set within CCtx.
    /// The dictionary will remain valid for future compression jobs using same CCtx.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Special : adding a NULL CDict means "return to no-dictionary mode".
    /// Note 1 : Currently, only one dictionary can be managed.
    /// Adding a new dictionary effectively "discards" any previous one.
    /// Note 2 : CDict is just referenced, its lifetime must outlive CCtx.
    pub fn ZSTD_CCtx_refCDict(
        cctx: *mut ZSTD_CCtx,
        cdict: *const ZSTD_CDict,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_refPrefix() :
    /// Reference a prefix (single-usage dictionary) for next compression job.
    /// Decompression need same prefix to properly regenerate data.
    /// Prefix is **only used once**. Tables are discarded at end of compression job.
    /// Subsequent compression jobs will be done without prefix (if none is explicitly referenced).
    /// If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_CDict instead.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary
    /// Note 1 : Prefix buffer is referenced. It must outlive compression job.
    /// Note 2 : Referencing a prefix involves building tables, which are dependent on compression parameters.
    /// It's a CPU consuming operation, with non-negligible impact on latency.
    /// Note 3 : By default, the prefix is treated as raw content (ZSTD_dm_rawContent).
    /// Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode.
    pub fn ZSTD_CCtx_refPrefix(
        cctx: *mut ZSTD_CCtx,
        prefix: *const ::libc::c_void,
        prefixSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_CCtx_refPrefix_advanced(
        cctx: *mut ZSTD_CCtx,
        prefix: *const ::libc::c_void,
        prefixSize: usize,
        dictContentType: ZSTD_dictContentType_e,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_reset() :
    /// Return a CCtx to clean state.
    /// Useful after an error, or to interrupt an ongoing compression job and start a new one.
    /// Any internal data not yet flushed is cancelled.
    /// Dictionary (if any) is dropped.
    /// All parameters are back to default values.
    /// It's possible to modify compression parameters after a reset.
    pub fn ZSTD_CCtx_reset(cctx: *mut ZSTD_CCtx);
}
pub const ZSTD_EndDirective_ZSTD_e_continue: ZSTD_EndDirective = 0;
pub const ZSTD_EndDirective_ZSTD_e_flush: ZSTD_EndDirective = 1;
pub const ZSTD_EndDirective_ZSTD_e_end: ZSTD_EndDirective = 2;
pub type ZSTD_EndDirective = u32;
extern "C" {
    /// ZSTD_compress_generic() :
    /// Behave about the same as ZSTD_compressStream. To note :
    /// - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_setParameter()
    /// - Compression parameters cannot be changed once compression is started.
    /// - outpot->pos must be <= dstCapacity, input->pos must be <= srcSize
    /// - outpot->pos and input->pos will be updated. They are guaranteed to remain below their respective limit.
    /// - In single-thread mode (default), function is blocking : it completed its job before returning to caller.
    /// - In multi-thread mode, function is non-blocking : it just acquires a copy of input, and distribute job to internal worker threads,
    /// and then immediately returns, just indicating that there is some data remaining to be flushed.
    /// The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte.
    /// - Exception : in multi-threading mode, if the first call requests a ZSTD_e_end directive, it is blocking : it will complete compression before giving back control to caller.
    /// - @return provides a minimum amount of data remaining to be flushed from internal buffers
    /// or an error code, which can be tested using ZSTD_isError().
    /// if @return != 0, flush is not fully completed, there is still some data left within internal buffers.
    /// This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers.
    /// For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed.
    /// - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),
    /// only ZSTD_e_end or ZSTD_e_flush operations are allowed.
    /// Before starting a new compression job, or changing compression parameters,
    /// it is required to fully flush internal buffers.
    pub fn ZSTD_compress_generic(
        cctx: *mut ZSTD_CCtx,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
        endOp: ZSTD_EndDirective,
    ) -> usize;
}
extern "C" {
    /// ZSTD_compress_generic_simpleArgs() :
    /// Same as ZSTD_compress_generic(),
    /// but using only integral types as arguments.
    /// Argument list is larger than ZSTD_{in,out}Buffer,
    /// but can be helpful for binders from dynamic languages
    /// which have troubles handling structures containing memory pointers.
    pub fn ZSTD_compress_generic_simpleArgs(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        dstPos: *mut usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        srcPos: *mut usize,
        endOp: ZSTD_EndDirective,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_params :
    /// Quick howto :
    /// - ZSTD_createCCtxParams() : Create a ZSTD_CCtx_params structure
    /// - ZSTD_CCtxParam_setParameter() : Push parameters one by one into
    /// an existing ZSTD_CCtx_params structure.
    /// This is similar to
    /// ZSTD_CCtx_setParameter().
    /// - ZSTD_CCtx_setParametersUsingCCtxParams() : Apply parameters to
    /// an existing CCtx.
    /// These parameters will be applied to
    /// all subsequent compression jobs.
    /// - ZSTD_compress_generic() : Do compression using the CCtx.
    /// - ZSTD_freeCCtxParams() : Free the memory.
    ///
    /// This can be used with ZSTD_estimateCCtxSize_advanced_usingCCtxParams()
    /// for static allocation for single-threaded compression.
    pub fn ZSTD_createCCtxParams() -> *mut ZSTD_CCtx_params;
}
extern "C" {
    pub fn ZSTD_freeCCtxParams(params: *mut ZSTD_CCtx_params) -> usize;
}
extern "C" {
    /// ZSTD_CCtxParams_reset() :
    /// Reset params to default values.
    pub fn ZSTD_CCtxParams_reset(params: *mut ZSTD_CCtx_params) -> usize;
}
extern "C" {
    /// ZSTD_CCtxParams_init() :
    /// Initializes the compression parameters of cctxParams according to
    /// compression level. All other parameters are reset to their default values.
    pub fn ZSTD_CCtxParams_init(
        cctxParams: *mut ZSTD_CCtx_params,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtxParams_init_advanced() :
    /// Initializes the compression and frame parameters of cctxParams according to
    /// params. All other parameters are reset to their default values.
    pub fn ZSTD_CCtxParams_init_advanced(
        cctxParams: *mut ZSTD_CCtx_params,
        params: ZSTD_parameters,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtxParam_setParameter() :
    /// Similar to ZSTD_CCtx_setParameter.
    /// Set one compression parameter, selected by enum ZSTD_cParameter.
    /// Parameters must be applied to a ZSTD_CCtx using ZSTD_CCtx_setParametersUsingCCtxParams().
    /// Note : when `value` is an enum, cast it to unsigned for proper type checking.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    pub fn ZSTD_CCtxParam_setParameter(
        params: *mut ZSTD_CCtx_params,
        param: ZSTD_cParameter,
        value: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    /// ZSTD_CCtx_setParametersUsingCCtxParams() :
    /// Apply a set of ZSTD_CCtx_params to the compression context.
    /// This can be done even after compression is started,
    /// if nbWorkers==0, this will have no impact until a new compression is started.
    /// if nbWorkers>=1, new parameters will be picked up at next job,
    /// with a few restrictions (windowLog, pledgedSrcSize, nbWorkers, jobSize, and overlapLog are not updated).
    pub fn ZSTD_CCtx_setParametersUsingCCtxParams(
        cctx: *mut ZSTD_CCtx,
        params: *const ZSTD_CCtx_params,
    ) -> usize;
}
extern "C" {
    /// ZSTD_DCtx_loadDictionary() :
    /// Create an internal DDict from dict buffer,
    /// to be used to decompress next frames.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,
    /// meaning "return to no-dictionary mode".
    /// Note 1 : `dict` content will be copied internally.
    /// Use ZSTD_DCtx_loadDictionary_byReference()
    /// to reference dictionary content instead.
    /// In which case, the dictionary buffer must outlive its users.
    /// Note 2 : Loading a dictionary involves building tables,
    /// which has a non-negligible impact on CPU usage and latency.
    /// Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to select
    /// how dictionary content will be interpreted and loaded.
    pub fn ZSTD_DCtx_loadDictionary(
        dctx: *mut ZSTD_DCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_DCtx_loadDictionary_byReference(
        dctx: *mut ZSTD_DCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_DCtx_loadDictionary_advanced(
        dctx: *mut ZSTD_DCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictLoadMethod: ZSTD_dictLoadMethod_e,
        dictContentType: ZSTD_dictContentType_e,
    ) -> usize;
}
extern "C" {
    /// ZSTD_DCtx_refDDict() :
    /// Reference a prepared dictionary, to be used to decompress next frames.
    /// The dictionary remains active for decompression of future frames using same DCtx.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Note 1 : Currently, only one dictionary can be managed.
    /// Referencing a new dictionary effectively "discards" any previous one.
    /// Special : adding a NULL DDict means "return to no-dictionary mode".
    /// Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.
    pub fn ZSTD_DCtx_refDDict(
        dctx: *mut ZSTD_DCtx,
        ddict: *const ZSTD_DDict,
    ) -> usize;
}
extern "C" {
    /// ZSTD_DCtx_refPrefix() :
    /// Reference a prefix (single-usage dictionary) for next compression job.
    /// Prefix is **only used once**. It must be explicitly referenced before each frame.
    /// If there is a need to use same prefix multiple times, consider embedding it into a ZSTD_DDict instead.
    /// @result : 0, or an error code (which can be tested with ZSTD_isError()).
    /// Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary
    /// Note 2 : Prefix buffer is referenced. It must outlive compression job.
    /// Note 3 : By default, the prefix is treated as raw content (ZSTD_dm_rawContent).
    /// Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode.
    /// Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost.
    pub fn ZSTD_DCtx_refPrefix(
        dctx: *mut ZSTD_DCtx,
        prefix: *const ::libc::c_void,
        prefixSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_DCtx_refPrefix_advanced(
        dctx: *mut ZSTD_DCtx,
        prefix: *const ::libc::c_void,
        prefixSize: usize,
        dictContentType: ZSTD_dictContentType_e,
    ) -> usize;
}
extern "C" {
    /// ZSTD_DCtx_setMaxWindowSize() :
    /// Refuses allocating internal buffers for frames requiring a window size larger than provided limit.
    /// This is useful to prevent a decoder context from reserving too much memory for itself (potential attack scenario).
    /// This parameter is only useful in streaming mode, since no internal buffer is allocated in direct mode.
    /// By default, a decompression context accepts all window sizes <= (1 << ZSTD_WINDOWLOG_MAX)
    /// @return : 0, or an error code (which can be tested using ZSTD_isError()).
    pub fn ZSTD_DCtx_setMaxWindowSize(
        dctx: *mut ZSTD_DCtx,
        maxWindowSize: usize,
    ) -> usize;
}
extern "C" {
    /// ZSTD_DCtx_setFormat() :
    /// Instruct the decoder context about what kind of data to decode next.
    /// This instruction is mandatory to decode data without a fully-formed header,
    /// such ZSTD_f_zstd1_magicless for example.
    /// @return : 0, or an error code (which can be tested using ZSTD_isError()).
    pub fn ZSTD_DCtx_setFormat(
        dctx: *mut ZSTD_DCtx,
        format: ZSTD_format_e,
    ) -> usize;
}
extern "C" {
    /// ZSTD_decompress_generic() :
    /// Behave the same as ZSTD_decompressStream.
    /// Decompression parameters cannot be changed once decompression is started.
    /// @return : an error code, which can be tested using ZSTD_isError()
    /// if >0, a hint, nb of expected input bytes for next invocation.
    /// `0` means : a frame has just been fully decoded and flushed.
    pub fn ZSTD_decompress_generic(
        dctx: *mut ZSTD_DCtx,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
    ) -> usize;
}
extern "C" {
    /// ZSTD_decompress_generic_simpleArgs() :
    /// Same as ZSTD_decompress_generic(),
    /// but using only integral types as arguments.
    /// Argument list is larger than ZSTD_{in,out}Buffer,
    /// but can be helpful for binders from dynamic languages
    /// which have troubles handling structures containing memory pointers.
    pub fn ZSTD_decompress_generic_simpleArgs(
        dctx: *mut ZSTD_DCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        dstPos: *mut usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        srcPos: *mut usize,
    ) -> usize;
}
extern "C" {
    /// ZSTD_DCtx_reset() :
    /// Return a DCtx to clean state.
    /// If a decompression was ongoing, any internal data not yet flushed is cancelled.
    /// All parameters are back to default values, including sticky ones.
    /// Dictionary (if any) is dropped.
    /// Parameters can be modified again after a reset.
    pub fn ZSTD_DCtx_reset(dctx: *mut ZSTD_DCtx);
}
extern "C" {
    pub fn ZSTD_getBlockSize(cctx: *const ZSTD_CCtx) -> usize;
}
extern "C" {
    pub fn ZSTD_compressBlock(
        cctx: *mut ZSTD_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_decompressBlock(
        dctx: *mut ZSTD_DCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_insertBlock(
        dctx: *mut ZSTD_DCtx,
        blockStart: *const ::libc::c_void,
        blockSize: usize,
    ) -> usize;
}
extern "C" {
    /// ZDICT_trainFromBuffer():
    /// Train a dictionary from an array of samples.
    /// Redirect towards ZDICT_optimizeTrainFromBuffer_cover() single-threaded, with d=8 and steps=4.
    /// Samples must be stored concatenated in a single flat buffer `samplesBuffer`,
    /// supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order.
    /// The resulting dictionary will be saved into `dictBuffer`.
    /// @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)
    /// or an error code, which can be tested with ZDICT_isError().
    /// Note: ZDICT_trainFromBuffer() requires about 9 bytes of memory for each input byte.
    /// Tips: In general, a reasonable dictionary has a size of ~ 100 KB.
    /// It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`.
    /// In general, it's recommended to provide a few thousands samples, though this can vary a lot.
    /// It's recommended that total size of all samples be about ~x100 times the target size of dictionary.
    pub fn ZDICT_trainFromBuffer(
        dictBuffer: *mut ::libc::c_void,
        dictBufferCapacity: usize,
        samplesBuffer: *const ::libc::c_void,
        samplesSizes: *const usize,
        nbSamples: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    pub fn ZDICT_getDictID(
        dictBuffer: *const ::libc::c_void,
        dictSize: usize,
    ) -> ::libc::c_uint;
}
extern "C" {
    pub fn ZDICT_isError(errorCode: usize) -> ::libc::c_uint;
}
extern "C" {
    pub fn ZDICT_getErrorName(errorCode: usize) -> *const ::libc::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTDMT_CCtx_s {
    _unused: [u8; 0],
}
pub type ZSTDMT_CCtx = ZSTDMT_CCtx_s;
extern "C" {
    pub fn ZSTDMT_createCCtx(nbWorkers: ::libc::c_uint) -> *mut ZSTDMT_CCtx;
}
extern "C" {
    pub fn ZSTDMT_createCCtx_advanced(
        nbWorkers: ::libc::c_uint,
        cMem: ZSTD_customMem,
    ) -> *mut ZSTDMT_CCtx;
}
extern "C" {
    pub fn ZSTDMT_freeCCtx(mtctx: *mut ZSTDMT_CCtx) -> usize;
}
extern "C" {
    pub fn ZSTDMT_sizeof_CCtx(mtctx: *mut ZSTDMT_CCtx) -> usize;
}
extern "C" {
    pub fn ZSTDMT_compressCCtx(
        mtctx: *mut ZSTDMT_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_initCStream(
        mtctx: *mut ZSTDMT_CCtx,
        compressionLevel: ::libc::c_int,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_resetCStream(
        mtctx: *mut ZSTDMT_CCtx,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_compressStream(
        mtctx: *mut ZSTDMT_CCtx,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_flushStream(
        mtctx: *mut ZSTDMT_CCtx,
        output: *mut ZSTD_outBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_endStream(
        mtctx: *mut ZSTDMT_CCtx,
        output: *mut ZSTD_outBuffer,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_compress_advanced(
        mtctx: *mut ZSTDMT_CCtx,
        dst: *mut ::libc::c_void,
        dstCapacity: usize,
        src: *const ::libc::c_void,
        srcSize: usize,
        cdict: *const ZSTD_CDict,
        params: ZSTD_parameters,
        overlapLog: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_initCStream_advanced(
        mtctx: *mut ZSTDMT_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
        params: ZSTD_parameters,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_initCStream_usingCDict(
        mtctx: *mut ZSTDMT_CCtx,
        cdict: *const ZSTD_CDict,
        fparams: ZSTD_frameParameters,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}
pub const ZSTDMT_parameter_ZSTDMT_p_jobSize: ZSTDMT_parameter = 0;
pub const ZSTDMT_parameter_ZSTDMT_p_overlapSectionLog: ZSTDMT_parameter = 1;
pub type ZSTDMT_parameter = u32;
extern "C" {
    pub fn ZSTDMT_setMTCtxParameter(
        mtctx: *mut ZSTDMT_CCtx,
        parameter: ZSTDMT_parameter,
        value: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    /// ZSTDMT_compressStream_generic() :
    /// Combines ZSTDMT_compressStream() with optional ZSTDMT_flushStream() or ZSTDMT_endStream()
    /// depending on flush directive.
    /// @return : minimum amount of data still to be flushed
    /// 0 if fully flushed
    /// or an error code
    /// note : needs to be init using any ZSTD_initCStream*() variant
    pub fn ZSTDMT_compressStream_generic(
        mtctx: *mut ZSTDMT_CCtx,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
        endOp: ZSTD_EndDirective,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_CCtxParam_setMTCtxParameter(
        params: *mut ZSTD_CCtx_params,
        parameter: ZSTDMT_parameter,
        value: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    pub fn ZSTDMT_CCtxParam_setNbWorkers(
        params: *mut ZSTD_CCtx_params,
        nbWorkers: ::libc::c_uint,
    ) -> usize;
}
extern "C" {
    /// ZSTDMT_updateCParams_whileCompressing() :
    /// Updates only a selected set of compression parameters, to remain compatible with current frame.
    /// New parameters will be applied to next compression job.
    pub fn ZSTDMT_updateCParams_whileCompressing(
        mtctx: *mut ZSTDMT_CCtx,
        cctxParams: *const ZSTD_CCtx_params,
    );
}
extern "C" {
    pub fn ZSTDMT_getNbWorkers(mtctx: *const ZSTDMT_CCtx) -> ::libc::c_uint;
}
extern "C" {
    pub fn ZSTDMT_getFrameProgression(
        mtctx: *mut ZSTDMT_CCtx,
    ) -> ZSTD_frameProgression;
}
extern "C" {
    /// ZSTDMT_initCStream_internal() :
    /// Private use only. Init streaming operation.
    /// expects params to be valid.
    /// must receive dict, or cdict, or none, but not both.
    /// @return : 0, or an error code
    pub fn ZSTDMT_initCStream_internal(
        zcs: *mut ZSTDMT_CCtx,
        dict: *const ::libc::c_void,
        dictSize: usize,
        dictContentType: ZSTD_dictContentType_e,
        cdict: *const ZSTD_CDict,
        params: ZSTD_CCtx_params,
        pledgedSrcSize: ::libc::c_ulonglong,
    ) -> usize;
}