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
/*
This file is auto-generated from the public API of the zstd library.
It is released under the same BSD license.

BSD License

For Zstandard software

Copyright (c) 2016-present, Facebook, Inc. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

 * Neither the name Facebook nor the names of its contributors may be used to
   endorse or promote products derived from this software without specific
   prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* automatically generated by rust-bindgen 0.56.0 */

pub const _LIBC_LIMITS_H_: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __GLIBC_USE_ISOC2X: u32 = 0;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_ISO_10646__: u32 = 201706;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 32;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __glibc_c99_flexarr_available: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
pub const __HAVE_GENERIC_SELECTION: u32 = 1;
pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
pub const MB_LEN_MAX: u32 = 16;
pub const _BITS_POSIX1_LIM_H: u32 = 1;
pub const _POSIX_AIO_LISTIO_MAX: u32 = 2;
pub const _POSIX_AIO_MAX: u32 = 1;
pub const _POSIX_ARG_MAX: u32 = 4096;
pub const _POSIX_CHILD_MAX: u32 = 25;
pub const _POSIX_DELAYTIMER_MAX: u32 = 32;
pub const _POSIX_HOST_NAME_MAX: u32 = 255;
pub const _POSIX_LINK_MAX: u32 = 8;
pub const _POSIX_LOGIN_NAME_MAX: u32 = 9;
pub const _POSIX_MAX_CANON: u32 = 255;
pub const _POSIX_MAX_INPUT: u32 = 255;
pub const _POSIX_MQ_OPEN_MAX: u32 = 8;
pub const _POSIX_MQ_PRIO_MAX: u32 = 32;
pub const _POSIX_NAME_MAX: u32 = 14;
pub const _POSIX_NGROUPS_MAX: u32 = 8;
pub const _POSIX_OPEN_MAX: u32 = 20;
pub const _POSIX_PATH_MAX: u32 = 256;
pub const _POSIX_PIPE_BUF: u32 = 512;
pub const _POSIX_RE_DUP_MAX: u32 = 255;
pub const _POSIX_RTSIG_MAX: u32 = 8;
pub const _POSIX_SEM_NSEMS_MAX: u32 = 256;
pub const _POSIX_SEM_VALUE_MAX: u32 = 32767;
pub const _POSIX_SIGQUEUE_MAX: u32 = 32;
pub const _POSIX_SSIZE_MAX: u32 = 32767;
pub const _POSIX_STREAM_MAX: u32 = 8;
pub const _POSIX_SYMLINK_MAX: u32 = 255;
pub const _POSIX_SYMLOOP_MAX: u32 = 8;
pub const _POSIX_TIMER_MAX: u32 = 32;
pub const _POSIX_TTY_NAME_MAX: u32 = 9;
pub const _POSIX_TZNAME_MAX: u32 = 6;
pub const _POSIX_CLOCKRES_MIN: u32 = 20000000;
pub const NR_OPEN: u32 = 1024;
pub const NGROUPS_MAX: u32 = 65536;
pub const ARG_MAX: u32 = 131072;
pub const LINK_MAX: u32 = 127;
pub const MAX_CANON: u32 = 255;
pub const MAX_INPUT: u32 = 255;
pub const NAME_MAX: u32 = 255;
pub const PATH_MAX: u32 = 4096;
pub const PIPE_BUF: u32 = 4096;
pub const XATTR_NAME_MAX: u32 = 255;
pub const XATTR_SIZE_MAX: u32 = 65536;
pub const XATTR_LIST_MAX: u32 = 65536;
pub const RTSIG_MAX: u32 = 32;
pub const _POSIX_THREAD_KEYS_MAX: u32 = 128;
pub const PTHREAD_KEYS_MAX: u32 = 1024;
pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4;
pub const _POSIX_THREAD_THREADS_MAX: u32 = 64;
pub const AIO_PRIO_DELTA_MAX: u32 = 20;
pub const PTHREAD_STACK_MIN: u32 = 16384;
pub const DELAYTIMER_MAX: u32 = 2147483647;
pub const TTY_NAME_MAX: u32 = 32;
pub const LOGIN_NAME_MAX: u32 = 256;
pub const HOST_NAME_MAX: u32 = 64;
pub const MQ_PRIO_MAX: u32 = 32768;
pub const SEM_VALUE_MAX: u32 = 2147483647;
pub const _BITS_POSIX2_LIM_H: u32 = 1;
pub const _POSIX2_BC_BASE_MAX: u32 = 99;
pub const _POSIX2_BC_DIM_MAX: u32 = 2048;
pub const _POSIX2_BC_SCALE_MAX: u32 = 99;
pub const _POSIX2_BC_STRING_MAX: u32 = 1000;
pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2;
pub const _POSIX2_EXPR_NEST_MAX: u32 = 32;
pub const _POSIX2_LINE_MAX: u32 = 2048;
pub const _POSIX2_RE_DUP_MAX: u32 = 255;
pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14;
pub const BC_BASE_MAX: u32 = 99;
pub const BC_DIM_MAX: u32 = 2048;
pub const BC_SCALE_MAX: u32 = 99;
pub const BC_STRING_MAX: u32 = 1000;
pub const COLL_WEIGHTS_MAX: u32 = 255;
pub const EXPR_NEST_MAX: u32 = 32;
pub const LINE_MAX: u32 = 2048;
pub const CHARCLASS_NAME_MAX: u32 = 2048;
pub const RE_DUP_MAX: u32 = 32767;
pub const ZSTD_VERSION_MAJOR: u32 = 1;
pub const ZSTD_VERSION_MINOR: u32 = 4;
pub const ZSTD_VERSION_RELEASE: u32 = 8;
pub const ZSTD_VERSION_NUMBER: u32 = 10408;
pub const ZSTD_CLEVEL_DEFAULT: u32 = 3;
pub const ZSTD_MAGICNUMBER: u32 = 4247762216;
pub const ZSTD_MAGIC_DICTIONARY: u32 = 3962610743;
pub const ZSTD_MAGIC_SKIPPABLE_START: u32 = 407710288;
pub const ZSTD_MAGIC_SKIPPABLE_MASK: u32 = 4294967280;
pub const ZSTD_BLOCKSIZELOG_MAX: u32 = 17;
pub const ZSTD_BLOCKSIZE_MAX: u32 = 131072;
pub const ZSTD_CONTENTSIZE_UNKNOWN: i32 = -1;
pub const ZSTD_CONTENTSIZE_ERROR: i32 = -2;
pub type wchar_t = libc::c_int;
extern "C" {
    #[doc = " ZSTD_versionNumber() :"]
    #[doc = "  Return runtime library version, the value is (MAJOR*100*100 + MINOR*100 + RELEASE)."]
    pub fn ZSTD_versionNumber() -> libc::c_uint;
}
extern "C" {
    #[doc = " ZSTD_versionString() :"]
    #[doc = "  Return runtime library version, like \"1.4.5\". Requires v1.3.0+."]
    pub fn ZSTD_versionString() -> *const libc::c_char;
}
extern "C" {
    #[doc = "  Simple API"]
    #[doc = "  Compresses `src` content as a single zstd compressed frame into already allocated `dst`."]
    #[doc = "  Hint : compression runs faster if `dstCapacity` >=  `ZSTD_compressBound(srcSize)`."]
    #[doc = "  @return : compressed size written into `dst` (<= `dstCapacity),"]
    #[doc = "            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" {
    #[doc = " ZSTD_decompress() :"]
    #[doc = "  `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames."]
    #[doc = "  `dstCapacity` is an upper bound of originalSize to regenerate."]
    #[doc = "  If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data."]
    #[doc = "  @return : the number of bytes decompressed into `dst` (<= `dstCapacity`),"]
    #[doc = "            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" {
    #[doc = " ZSTD_getDecompressedSize() :"]
    #[doc = "  NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize()."]
    #[doc = "  Both functions work the same way, but ZSTD_getDecompressedSize() blends"]
    #[doc = "  \"empty\", \"unknown\" and \"error\" results to the same return value (0),"]
    #[doc = "  while ZSTD_getFrameContentSize() gives them separate return values."]
    #[doc = " @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise."]
    pub fn ZSTD_getDecompressedSize(
        src: *const libc::c_void,
        srcSize: usize,
    ) -> libc::c_ulonglong;
}
extern "C" {
    #[doc = " ZSTD_findFrameCompressedSize() :"]
    #[doc = " `src` should point to the start of a ZSTD frame or skippable frame."]
    #[doc = " `srcSize` must be >= first frame size"]
    #[doc = " @return : the compressed size of the first frame starting at `src`,"]
    #[doc = "           suitable to pass as `srcSize` to `ZSTD_decompress` or similar,"]
    #[doc = "        or an error code if input is invalid"]
    pub fn ZSTD_findFrameCompressedSize(
        src: *const libc::c_void,
        srcSize: usize,
    ) -> usize;
}
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_minCLevel() -> libc::c_int;
}
extern "C" {
    pub fn ZSTD_maxCLevel() -> libc::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_CCtx_s {
    _unused: [u8; 0],
}
#[doc = "  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" {
    #[doc = " ZSTD_compressCCtx() :"]
    #[doc = "  Same as ZSTD_compress(), using an explicit ZSTD_CCtx."]
    #[doc = "  Important : in order to behave similarly to `ZSTD_compress()`,"]
    #[doc = "  this function compresses at requested compression level,"]
    #[doc = "  __ignoring any other parameter__ ."]
    #[doc = "  If any advanced parameter was set using the advanced API,"]
    #[doc = "  they will all be reset. Only `compressionLevel` remains."]
    pub fn ZSTD_compressCCtx(
        cctx: *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" {
    #[doc = " ZSTD_decompressDCtx() :"]
    #[doc = "  Same as ZSTD_decompress(),"]
    #[doc = "  requires an allocated ZSTD_DCtx."]
    #[doc = "  Compatible with sticky parameters."]
    pub fn ZSTD_decompressDCtx(
        dctx: *mut ZSTD_DCtx,
        dst: *mut libc::c_void,
        dstCapacity: usize,
        src: *const libc::c_void,
        srcSize: usize,
    ) -> usize;
}
#[repr(u32)]
#[doc = "  Advanced compression API"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ZSTD_strategy {
    ZSTD_fast = 1,
    ZSTD_dfast = 2,
    ZSTD_greedy = 3,
    ZSTD_lazy = 4,
    ZSTD_lazy2 = 5,
    ZSTD_btlazy2 = 6,
    ZSTD_btopt = 7,
    ZSTD_btultra = 8,
    ZSTD_btultra2 = 9,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ZSTD_cParameter {
    ZSTD_c_compressionLevel = 100,
    ZSTD_c_windowLog = 101,
    ZSTD_c_hashLog = 102,
    ZSTD_c_chainLog = 103,
    ZSTD_c_searchLog = 104,
    ZSTD_c_minMatch = 105,
    ZSTD_c_targetLength = 106,
    ZSTD_c_strategy = 107,
    ZSTD_c_enableLongDistanceMatching = 160,
    ZSTD_c_ldmHashLog = 161,
    ZSTD_c_ldmMinMatch = 162,
    ZSTD_c_ldmBucketSizeLog = 163,
    ZSTD_c_ldmHashRateLog = 164,
    ZSTD_c_contentSizeFlag = 200,
    ZSTD_c_checksumFlag = 201,
    ZSTD_c_dictIDFlag = 202,
    ZSTD_c_nbWorkers = 400,
    ZSTD_c_jobSize = 401,
    ZSTD_c_overlapLog = 402,
    ZSTD_c_experimentalParam1 = 500,
    ZSTD_c_experimentalParam2 = 10,
    ZSTD_c_experimentalParam3 = 1000,
    ZSTD_c_experimentalParam4 = 1001,
    ZSTD_c_experimentalParam5 = 1002,
    ZSTD_c_experimentalParam6 = 1003,
    ZSTD_c_experimentalParam7 = 1004,
    ZSTD_c_experimentalParam8 = 1005,
    ZSTD_c_experimentalParam9 = 1006,
    ZSTD_c_experimentalParam10 = 1007,
    ZSTD_c_experimentalParam11 = 1008,
    ZSTD_c_experimentalParam12 = 1009,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_bounds {
    pub error: usize,
    pub lowerBound: libc::c_int,
    pub upperBound: libc::c_int,
}
#[test]
fn bindgen_test_layout_ZSTD_bounds() {
    assert_eq!(
        ::core::mem::size_of::<ZSTD_bounds>(),
        16usize,
        concat!("Size of: ", stringify!(ZSTD_bounds))
    );
    assert_eq!(
        ::core::mem::align_of::<ZSTD_bounds>(),
        8usize,
        concat!("Alignment of ", stringify!(ZSTD_bounds))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_bounds>())).error as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_bounds),
            "::",
            stringify!(error)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_bounds>())).lowerBound as *const _
                as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_bounds),
            "::",
            stringify!(lowerBound)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZSTD_bounds>())).upperBound as *const _
                as usize
        },
        12usize,
        concat!(
            "Offset of field: ",
            stringify!(ZSTD_bounds),
            "::",
            stringify!(upperBound)
        )
    );
}
extern "C" {
    #[doc = " ZSTD_cParam_getBounds() :"]
    #[doc = "  All parameters must belong to an interval with lower and upper bounds,"]
    #[doc = "  otherwise they will either trigger an error or be automatically clamped."]
    #[doc = " @return : a structure, ZSTD_bounds, which contains"]
    #[doc = "         - an error status field, which must be tested using ZSTD_isError()"]
    #[doc = "         - lower and upper bounds, both inclusive"]
    pub fn ZSTD_cParam_getBounds(cParam: ZSTD_cParameter) -> ZSTD_bounds;
}
extern "C" {
    #[doc = " ZSTD_CCtx_setParameter() :"]
    #[doc = "  Set one compression parameter, selected by enum ZSTD_cParameter."]
    #[doc = "  All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds()."]
    #[doc = "  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter)."]
    #[doc = "  Setting a parameter is generally only possible during frame initialization (before starting compression)."]
    #[doc = "  Exception : when using multi-threading mode (nbWorkers >= 1),"]
    #[doc = "              the following parameters can be updated _during_ compression (within same frame):"]
    #[doc = "              => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy."]
    #[doc = "              new parameters will be active for next job only (after a flush())."]
    #[doc = " @return : an error code (which can be tested using ZSTD_isError())."]
    pub fn ZSTD_CCtx_setParameter(
        cctx: *mut ZSTD_CCtx,
        param: ZSTD_cParameter,
        value: libc::c_int,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_CCtx_setPledgedSrcSize() :"]
    #[doc = "  Total input data size to be compressed as a single frame."]
    #[doc = "  Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag."]
    #[doc = "  This value will also be controlled at end of frame, and trigger an error if not respected."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame."]
    #[doc = "           In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN."]
    #[doc = "           ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame."]
    #[doc = "  Note 2 : pledgedSrcSize is only valid once, for the next frame."]
    #[doc = "           It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN."]
    #[doc = "  Note 3 : Whenever all input data is provided and consumed in a single round,"]
    #[doc = "           for example with ZSTD_compress2(),"]
    #[doc = "           or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end),"]
    #[doc = "           this value is automatically overridden by srcSize instead."]
    pub fn ZSTD_CCtx_setPledgedSrcSize(
        cctx: *mut ZSTD_CCtx,
        pledgedSrcSize: libc::c_ulonglong,
    ) -> usize;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ZSTD_ResetDirective {
    ZSTD_reset_session_only = 1,
    ZSTD_reset_parameters = 2,
    ZSTD_reset_session_and_parameters = 3,
}
extern "C" {
    #[doc = " ZSTD_CCtx_reset() :"]
    #[doc = "  There are 2 different things that can be reset, independently or jointly :"]
    #[doc = "  - The session : will stop compressing current frame, and make CCtx ready to start a new one."]
    #[doc = "                  Useful after an error, or to interrupt any ongoing compression."]
    #[doc = "                  Any internal data not yet flushed is cancelled."]
    #[doc = "                  Compression parameters and dictionary remain unchanged."]
    #[doc = "                  They will be used to compress next frame."]
    #[doc = "                  Resetting session never fails."]
    #[doc = "  - The parameters : changes all parameters back to \"default\"."]
    #[doc = "                  This removes any reference to any dictionary too."]
    #[doc = "                  Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing)"]
    #[doc = "                  otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError())"]
    #[doc = "  - Both : similar to resetting the session, followed by resetting parameters."]
    pub fn ZSTD_CCtx_reset(
        cctx: *mut ZSTD_CCtx,
        reset: ZSTD_ResetDirective,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_compress2() :"]
    #[doc = "  Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API."]
    #[doc = "  ZSTD_compress2() always starts a new frame."]
    #[doc = "  Should cctx hold data from a previously unfinished frame, everything about it is forgotten."]
    #[doc = "  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
    #[doc = "  - The function is always blocking, returns when compression is completed."]
    #[doc = "  Hint : compression runs faster if `dstCapacity` >=  `ZSTD_compressBound(srcSize)`."]
    #[doc = " @return : compressed size written into `dst` (<= `dstCapacity),"]
    #[doc = "           or an error code if it fails (which can be tested using ZSTD_isError())."]
    pub fn ZSTD_compress2(
        cctx: *mut ZSTD_CCtx,
        dst: *mut libc::c_void,
        dstCapacity: usize,
        src: *const libc::c_void,
        srcSize: usize,
    ) -> usize;
}
#[repr(u32)]
#[doc = "  Advanced decompression API"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ZSTD_dParameter {
    ZSTD_d_windowLogMax = 100,
    ZSTD_d_experimentalParam1 = 1000,
    ZSTD_d_experimentalParam2 = 1001,
    ZSTD_d_experimentalParam3 = 1002,
}
extern "C" {
    #[doc = " ZSTD_dParam_getBounds() :"]
    #[doc = "  All parameters must belong to an interval with lower and upper bounds,"]
    #[doc = "  otherwise they will either trigger an error or be automatically clamped."]
    #[doc = " @return : a structure, ZSTD_bounds, which contains"]
    #[doc = "         - an error status field, which must be tested using ZSTD_isError()"]
    #[doc = "         - both lower and upper bounds, inclusive"]
    pub fn ZSTD_dParam_getBounds(dParam: ZSTD_dParameter) -> ZSTD_bounds;
}
extern "C" {
    #[doc = " ZSTD_DCtx_setParameter() :"]
    #[doc = "  Set one compression parameter, selected by enum ZSTD_dParameter."]
    #[doc = "  All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds()."]
    #[doc = "  Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter)."]
    #[doc = "  Setting a parameter is only possible during frame initialization (before starting decompression)."]
    #[doc = " @return : 0, or an error code (which can be tested using ZSTD_isError())."]
    pub fn ZSTD_DCtx_setParameter(
        dctx: *mut ZSTD_DCtx,
        param: ZSTD_dParameter,
        value: libc::c_int,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_DCtx_reset() :"]
    #[doc = "  Return a DCtx to clean state."]
    #[doc = "  Session and parameters can be reset jointly or separately."]
    #[doc = "  Parameters can only be reset when no active frame is being decompressed."]
    #[doc = " @return : 0, or an error code, which can be tested with ZSTD_isError()"]
    pub fn ZSTD_DCtx_reset(
        dctx: *mut ZSTD_DCtx,
        reset: ZSTD_ResetDirective,
    ) -> usize;
}
#[doc = "  Streaming"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_inBuffer_s {
    #[doc = "< start of input buffer"]
    pub src: *const libc::c_void,
    #[doc = "< size of input buffer"]
    pub size: usize,
    #[doc = "< 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)
        )
    );
}
#[doc = "  Streaming"]
pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_outBuffer_s {
    #[doc = "< start of output buffer"]
    pub dst: *mut libc::c_void,
    #[doc = "< size of output buffer"]
    pub size: usize,
    #[doc = "< 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;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum ZSTD_EndDirective {
    ZSTD_e_continue = 0,
    ZSTD_e_flush = 1,
    ZSTD_e_end = 2,
}
extern "C" {
    #[doc = " ZSTD_compressStream2() :"]
    #[doc = "  Behaves about the same as ZSTD_compressStream, with additional control on end directive."]
    #[doc = "  - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*()"]
    #[doc = "  - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode)"]
    #[doc = "  - output->pos must be <= dstCapacity, input->pos must be <= srcSize"]
    #[doc = "  - output->pos and input->pos will be updated. They are guaranteed to remain below their respective limit."]
    #[doc = "  - endOp must be a valid directive"]
    #[doc = "  - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller."]
    #[doc = "  - When nbWorkers>=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available,"]
    #[doc = "                                                  and then immediately returns, just indicating that there is some data remaining to be flushed."]
    #[doc = "                                                  The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte."]
    #[doc = "  - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking."]
    #[doc = "  - @return provides a minimum amount of data remaining to be flushed from internal buffers"]
    #[doc = "            or an error code, which can be tested using ZSTD_isError()."]
    #[doc = "            if @return != 0, flush is not fully completed, there is still some data left within internal buffers."]
    #[doc = "            This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers."]
    #[doc = "            For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed."]
    #[doc = "  - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0),"]
    #[doc = "            only ZSTD_e_end or ZSTD_e_flush operations are allowed."]
    #[doc = "            Before starting a new compression job, or changing compression parameters,"]
    #[doc = "            it is required to fully flush internal buffers."]
    pub fn ZSTD_compressStream2(
        cctx: *mut ZSTD_CCtx,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
        endOp: ZSTD_EndDirective,
    ) -> usize;
}
extern "C" {
    pub fn ZSTD_CStreamInSize() -> usize;
}
extern "C" {
    pub fn ZSTD_CStreamOutSize() -> usize;
}
extern "C" {
    #[doc = " Equivalent to:"]
    #[doc = ""]
    #[doc = "     ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only);"]
    #[doc = "     ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any)"]
    #[doc = "     ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel);"]
    pub fn ZSTD_initCStream(
        zcs: *mut ZSTD_CStream,
        compressionLevel: libc::c_int,
    ) -> usize;
}
extern "C" {
    #[doc = " Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue)."]
    #[doc = " NOTE: The return value is different. ZSTD_compressStream() returns a hint for"]
    #[doc = " the next read size (if non-zero and not an error). ZSTD_compressStream2()"]
    #[doc = " returns the minimum nb of bytes left to flush (if non-zero and not an error)."]
    pub fn ZSTD_compressStream(
        zcs: *mut ZSTD_CStream,
        output: *mut ZSTD_outBuffer,
        input: *mut ZSTD_inBuffer,
    ) -> usize;
}
extern "C" {
    #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush)."]
    pub fn ZSTD_flushStream(
        zcs: *mut ZSTD_CStream,
        output: *mut ZSTD_outBuffer,
    ) -> usize;
}
extern "C" {
    #[doc = " Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end)."]
    pub fn ZSTD_endStream(
        zcs: *mut ZSTD_CStream,
        output: *mut ZSTD_outBuffer,
    ) -> 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;
}
extern "C" {
    #[doc = "  Simple dictionary API"]
    #[doc = "  Compression at an explicit compression level using a Dictionary."]
    #[doc = "  A dictionary can be any arbitrary data segment (also called a prefix),"]
    #[doc = "  or a buffer with specified information (see dictBuilder/zdict.h)."]
    #[doc = "  Note : This function loads the dictionary, resulting in significant startup delay."]
    #[doc = "         It's intended for a dictionary used only once."]
    #[doc = "  Note 2 : 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" {
    #[doc = " ZSTD_decompress_usingDict() :"]
    #[doc = "  Decompression using a known Dictionary."]
    #[doc = "  Dictionary must be identical to the one used during compression."]
    #[doc = "  Note : This function loads the dictionary, resulting in significant startup delay."]
    #[doc = "         It's intended for a dictionary used only once."]
    #[doc = "  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],
}
#[doc = "  Bulk processing dictionary API"]
pub type ZSTD_CDict = ZSTD_CDict_s;
extern "C" {
    #[doc = " ZSTD_createCDict() :"]
    #[doc = "  When compressing multiple messages or blocks using the same dictionary,"]
    #[doc = "  it's recommended to digest the dictionary only once, since it's a costly operation."]
    #[doc = "  ZSTD_createCDict() will create a state from digesting a dictionary."]
    #[doc = "  The resulting state can be used for future compression operations with very limited startup cost."]
    #[doc = "  ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only."]
    #[doc = " @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict."]
    #[doc = "  Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content."]
    #[doc = "  Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer,"]
    #[doc = "      in which case the only thing that it transports is the @compressionLevel."]
    #[doc = "      This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively,"]
    #[doc = "      expecting a ZSTD_CDict parameter with any data, including those without a known dictionary."]
    pub fn ZSTD_createCDict(
        dictBuffer: *const libc::c_void,
        dictSize: usize,
        compressionLevel: libc::c_int,
    ) -> *mut ZSTD_CDict;
}
extern "C" {
    #[doc = " ZSTD_freeCDict() :"]
    #[doc = "  Function frees memory allocated by ZSTD_createCDict()."]
    pub fn ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize;
}
extern "C" {
    #[doc = " ZSTD_compress_usingCDict() :"]
    #[doc = "  Compression using a digested Dictionary."]
    #[doc = "  Recommended when same dictionary is used multiple times."]
    #[doc = "  Note : compression level is _decided at dictionary creation time_,"]
    #[doc = "     and 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" {
    #[doc = " ZSTD_createDDict() :"]
    #[doc = "  Create a digested dictionary, ready to start decompression operation without startup delay."]
    #[doc = "  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" {
    #[doc = " ZSTD_freeDDict() :"]
    #[doc = "  Function frees memory allocated with ZSTD_createDDict()"]
    pub fn ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize;
}
extern "C" {
    #[doc = " ZSTD_decompress_usingDDict() :"]
    #[doc = "  Decompression using a digested Dictionary."]
    #[doc = "  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;
}
extern "C" {
    #[doc = " ZSTD_getDictID_fromDict() :"]
    #[doc = "  Provides the dictID stored within dictionary."]
    #[doc = "  if @return == 0, the dictionary is not conformant with Zstandard specification."]
    #[doc = "  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" {
    #[doc = " ZSTD_getDictID_fromDDict() :"]
    #[doc = "  Provides the dictID of the dictionary loaded into `ddict`."]
    #[doc = "  If @return == 0, the dictionary is not conformant to Zstandard specification, or empty."]
    #[doc = "  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" {
    #[doc = " ZSTD_getDictID_fromFrame() :"]
    #[doc = "  Provides the dictID required to decompressed the frame stored within `src`."]
    #[doc = "  If @return == 0, the dictID could not be decoded."]
    #[doc = "  This could for one of the following reasons :"]
    #[doc = "  - The frame does not require a dictionary to be decoded (most common case)."]
    #[doc = "  - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden information."]
    #[doc = "    Note : this use case also happens when using a non-conformant dictionary."]
    #[doc = "  - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize < ZSTD_FRAMEHEADERSIZE_MAX`)."]
    #[doc = "  - This is not a Zstandard frame."]
    #[doc = "  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" {
    #[doc = " ZSTD_CCtx_loadDictionary() :"]
    #[doc = "  Create an internal CDict from `dict` buffer."]
    #[doc = "  Decompression will have to use same dictionary."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary,"]
    #[doc = "           meaning \"return to no-dictionary mode\"."]
    #[doc = "  Note 1 : Dictionary is sticky, it will be used for all future compressed frames."]
    #[doc = "           To return to \"no-dictionary\" situation, load a NULL dictionary (or reset parameters)."]
    #[doc = "  Note 2 : Loading a dictionary involves building tables."]
    #[doc = "           It's also a CPU consuming operation, with non-negligible impact on latency."]
    #[doc = "           Tables are dependent on compression parameters, and for this reason,"]
    #[doc = "           compression parameters can no longer be changed after loading a dictionary."]
    #[doc = "  Note 3 :`dict` content will be copied internally."]
    #[doc = "           Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead."]
    #[doc = "           In such a case, dictionary buffer must outlive its users."]
    #[doc = "  Note 4 : Use ZSTD_CCtx_loadDictionary_advanced()"]
    #[doc = "           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" {
    #[doc = " ZSTD_CCtx_refCDict() :"]
    #[doc = "  Reference a prepared dictionary, to be used for all next compressed frames."]
    #[doc = "  Note that compression parameters are enforced from within CDict,"]
    #[doc = "  and supersede any compression parameter previously set within CCtx."]
    #[doc = "  The parameters ignored are labled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs."]
    #[doc = "  The ignored parameters will be used again if the CCtx is returned to no-dictionary mode."]
    #[doc = "  The dictionary will remain valid for future compressed frames using same CCtx."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Special : Referencing a NULL CDict means \"return to no-dictionary mode\"."]
    #[doc = "  Note 1 : Currently, only one dictionary can be managed."]
    #[doc = "           Referencing a new dictionary effectively \"discards\" any previous one."]
    #[doc = "  Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx."]
    pub fn ZSTD_CCtx_refCDict(
        cctx: *mut ZSTD_CCtx,
        cdict: *const ZSTD_CDict,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_CCtx_refPrefix() :"]
    #[doc = "  Reference a prefix (single-usage dictionary) for next compressed frame."]
    #[doc = "  A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end)."]
    #[doc = "  Decompression will need same prefix to properly regenerate data."]
    #[doc = "  Compressing with a prefix is similar in outcome as performing a diff and compressing it,"]
    #[doc = "  but performs much faster, especially during decompression (compression speed is tunable with compression level)."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary"]
    #[doc = "  Note 1 : Prefix buffer is referenced. It **must** outlive compression."]
    #[doc = "           Its content must remain unmodified during compression."]
    #[doc = "  Note 2 : If the intention is to diff some large src data blob with some prior version of itself,"]
    #[doc = "           ensure that the window size is large enough to contain the entire source."]
    #[doc = "           See ZSTD_c_windowLog."]
    #[doc = "  Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters."]
    #[doc = "           It's a CPU consuming operation, with non-negligible impact on latency."]
    #[doc = "           If there is a need to use the same prefix multiple times, consider loadDictionary instead."]
    #[doc = "  Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent)."]
    #[doc = "           Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation."]
    pub fn ZSTD_CCtx_refPrefix(
        cctx: *mut ZSTD_CCtx,
        prefix: *const libc::c_void,
        prefixSize: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_DCtx_loadDictionary() :"]
    #[doc = "  Create an internal DDict from dict buffer,"]
    #[doc = "  to be used to decompress next frames."]
    #[doc = "  The dictionary remains valid for all future frames, until explicitly invalidated."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary,"]
    #[doc = "            meaning \"return to no-dictionary mode\"."]
    #[doc = "  Note 1 : Loading a dictionary involves building tables,"]
    #[doc = "           which has a non-negligible impact on CPU usage and latency."]
    #[doc = "           It's recommended to \"load once, use many times\", to amortize the cost"]
    #[doc = "  Note 2 :`dict` content will be copied internally, so `dict` can be released after loading."]
    #[doc = "           Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead."]
    #[doc = "  Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of"]
    #[doc = "           how dictionary content is loaded and interpreted."]
    pub fn ZSTD_DCtx_loadDictionary(
        dctx: *mut ZSTD_DCtx,
        dict: *const libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_DCtx_refDDict() :"]
    #[doc = "  Reference a prepared dictionary, to be used to decompress next frames."]
    #[doc = "  The dictionary remains active for decompression of future frames using same DCtx."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Note 1 : Currently, only one dictionary can be managed."]
    #[doc = "           Referencing a new dictionary effectively \"discards\" any previous one."]
    #[doc = "  Special: referencing a NULL DDict means \"return to no-dictionary mode\"."]
    #[doc = "  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" {
    #[doc = " ZSTD_DCtx_refPrefix() :"]
    #[doc = "  Reference a prefix (single-usage dictionary) to decompress next frame."]
    #[doc = "  This is the reverse operation of ZSTD_CCtx_refPrefix(),"]
    #[doc = "  and must use the same prefix as the one used during compression."]
    #[doc = "  Prefix is **only used once**. Reference is discarded at end of frame."]
    #[doc = "  End of frame is reached when ZSTD_decompressStream() returns 0."]
    #[doc = " @result : 0, or an error code (which can be tested with ZSTD_isError())."]
    #[doc = "  Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary"]
    #[doc = "  Note 2 : Prefix buffer is referenced. It **must** outlive decompression."]
    #[doc = "           Prefix buffer must remain unmodified up to the end of frame,"]
    #[doc = "           reached when ZSTD_decompressStream() returns 0."]
    #[doc = "  Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent)."]
    #[doc = "           Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section)"]
    #[doc = "  Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost."]
    #[doc = "           A full dictionary is more costly, as it requires building tables."]
    pub fn ZSTD_DCtx_refPrefix(
        dctx: *mut ZSTD_DCtx,
        prefix: *const libc::c_void,
        prefixSize: usize,
    ) -> usize;
}
extern "C" {
    #[doc = " ZSTD_sizeof_*() :"]
    #[doc = "  These functions give the _current_ memory usage of selected object."]
    #[doc = "  Note that object memory usage can evolve (increase or decrease) over time."]
    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" {
    #[doc = " ZDICT_trainFromBuffer():"]
    #[doc = "  Train a dictionary from an array of samples."]
    #[doc = "  Redirect towards ZDICT_optimizeTrainFromBuffer_fastCover() single-threaded, with d=8, steps=4,"]
    #[doc = "  f=20, and accel=1."]
    #[doc = "  Samples must be stored concatenated in a single flat buffer `samplesBuffer`,"]
    #[doc = "  supplied with an array of sizes `samplesSizes`, providing the size of each sample, in order."]
    #[doc = "  The resulting dictionary will be saved into `dictBuffer`."]
    #[doc = " @return: size of dictionary stored into `dictBuffer` (<= `dictBufferCapacity`)"]
    #[doc = "          or an error code, which can be tested with ZDICT_isError()."]
    #[doc = "  Note:  Dictionary training will fail if there are not enough samples to construct a"]
    #[doc = "         dictionary, or if most of the samples are too small (< 8 bytes being the lower limit)."]
    #[doc = "         If dictionary training fails, you should use zstd without a dictionary, as the dictionary"]
    #[doc = "         would've been ineffective anyways. If you believe your samples would benefit from a dictionary"]
    #[doc = "         please open an issue with details, and we can look into it."]
    #[doc = "  Note: ZDICT_trainFromBuffer()'s memory usage is about 6 MB."]
    #[doc = "  Tips: In general, a reasonable dictionary has a size of ~ 100 KB."]
    #[doc = "        It's possible to select smaller or larger size, just by specifying `dictBufferCapacity`."]
    #[doc = "        In general, it's recommended to provide a few thousands samples, though this can vary a lot."]
    #[doc = "        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;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZDICT_params_t {
    pub compressionLevel: libc::c_int,
    pub notificationLevel: libc::c_uint,
    pub dictID: libc::c_uint,
}
#[test]
fn bindgen_test_layout_ZDICT_params_t() {
    assert_eq!(
        ::core::mem::size_of::<ZDICT_params_t>(),
        12usize,
        concat!("Size of: ", stringify!(ZDICT_params_t))
    );
    assert_eq!(
        ::core::mem::align_of::<ZDICT_params_t>(),
        4usize,
        concat!("Alignment of ", stringify!(ZDICT_params_t))
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZDICT_params_t>())).compressionLevel
                as *const _ as usize
        },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(ZDICT_params_t),
            "::",
            stringify!(compressionLevel)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZDICT_params_t>())).notificationLevel
                as *const _ as usize
        },
        4usize,
        concat!(
            "Offset of field: ",
            stringify!(ZDICT_params_t),
            "::",
            stringify!(notificationLevel)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::core::ptr::null::<ZDICT_params_t>())).dictID as *const _
                as usize
        },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(ZDICT_params_t),
            "::",
            stringify!(dictID)
        )
    );
}
extern "C" {
    #[doc = " ZDICT_finalizeDictionary():"]
    #[doc = " Given a custom content as a basis for dictionary, and a set of samples,"]
    #[doc = " finalize dictionary by adding headers and statistics according to the zstd"]
    #[doc = " dictionary format."]
    #[doc = ""]
    #[doc = " Samples must be stored concatenated in a flat buffer `samplesBuffer`,"]
    #[doc = " supplied with an array of sizes `samplesSizes`, providing the size of each"]
    #[doc = " sample in order. The samples are used to construct the statistics, so they"]
    #[doc = " should be representative of what you will compress with this dictionary."]
    #[doc = ""]
    #[doc = " The compression level can be set in `parameters`. You should pass the"]
    #[doc = " compression level you expect to use in production. The statistics for each"]
    #[doc = " compression level differ, so tuning the dictionary for the compression level"]
    #[doc = " can help quite a bit."]
    #[doc = ""]
    #[doc = " You can set an explicit dictionary ID in `parameters`, or allow us to pick"]
    #[doc = " a random dictionary ID for you, but we can't guarantee no collisions."]
    #[doc = ""]
    #[doc = " The dstDictBuffer and the dictContent may overlap, and the content will be"]
    #[doc = " appended to the end of the header. If the header + the content doesn't fit in"]
    #[doc = " maxDictSize the beginning of the content is truncated to make room, since it"]
    #[doc = " is presumed that the most profitable content is at the end of the dictionary,"]
    #[doc = " since that is the cheapest to reference."]
    #[doc = ""]
    #[doc = " `dictContentSize` must be >= ZDICT_CONTENTSIZE_MIN bytes."]
    #[doc = " `maxDictSize` must be >= max(dictContentSize, ZSTD_DICTSIZE_MIN)."]
    #[doc = ""]
    #[doc = " @return: size of dictionary stored into `dstDictBuffer` (<= `maxDictSize`),"]
    #[doc = "          or an error code, which can be tested by ZDICT_isError()."]
    #[doc = " Note: ZDICT_finalizeDictionary() will push notifications into stderr if"]
    #[doc = "       instructed to, using notificationLevel>0."]
    #[doc = " NOTE: This function currently may fail in several edge cases including:"]
    #[doc = "         * Not enough samples"]
    #[doc = "         * Samples are uncompressible"]
    #[doc = "         * Samples are all exactly the same"]
    pub fn ZDICT_finalizeDictionary(
        dstDictBuffer: *mut libc::c_void,
        maxDictSize: usize,
        dictContent: *const libc::c_void,
        dictContentSize: usize,
        samplesBuffer: *const libc::c_void,
        samplesSizes: *const usize,
        nbSamples: libc::c_uint,
        parameters: ZDICT_params_t,
    ) -> usize;
}
extern "C" {
    pub fn ZDICT_getDictID(
        dictBuffer: *const libc::c_void,
        dictSize: usize,
    ) -> libc::c_uint;
}
extern "C" {
    pub fn ZDICT_getDictHeaderSize(
        dictBuffer: *const libc::c_void,
        dictSize: usize,
    ) -> usize;
}
extern "C" {
    pub fn ZDICT_isError(errorCode: usize) -> libc::c_uint;
}
extern "C" {
    pub fn ZDICT_getErrorName(errorCode: usize) -> *const libc::c_char;
}