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
pub const ZSTD_VERSION_MAJOR: ::libc::c_uint = 1;
pub const ZSTD_VERSION_MINOR: ::libc::c_uint = 2;
pub const ZSTD_VERSION_RELEASE: ::libc::c_uint = 0;
pub const ZSTD_VERSION_NUMBER: ::libc::c_uint = 10200;
pub const ZSTD_MAGICNUMBER: ::libc::c_uint = 4247762216;
pub const ZSTD_MAGIC_SKIPPABLE_START: ::libc::c_uint = 407710288;
pub const ZSTD_CONTENTSIZE_UNKNOWN: ::libc::c_int = -1;
pub const ZSTD_CONTENTSIZE_ERROR: ::libc::c_int = -2;
pub const ZSTD_WINDOWLOG_MAX_32: ::libc::c_uint = 27;
pub const ZSTD_WINDOWLOG_MAX_64: ::libc::c_uint = 27;
pub const ZSTD_WINDOWLOG_MIN: ::libc::c_uint = 10;
pub const ZSTD_HASHLOG_MIN: ::libc::c_uint = 6;
pub const ZSTD_CHAINLOG_MIN: ::libc::c_uint = 6;
pub const ZSTD_HASHLOG3_MAX: ::libc::c_uint = 17;
pub const ZSTD_SEARCHLOG_MIN: ::libc::c_uint = 1;
pub const ZSTD_SEARCHLENGTH_MAX: ::libc::c_uint = 7;
pub const ZSTD_SEARCHLENGTH_MIN: ::libc::c_uint = 3;
pub const ZSTD_TARGETLENGTH_MIN: ::libc::c_uint = 4;
pub const ZSTD_TARGETLENGTH_MAX: ::libc::c_uint = 999;
pub const ZSTD_FRAMEHEADERSIZE_MAX: ::libc::c_uint = 18;
pub const ZSTD_FRAMEHEADERSIZE_MIN: ::libc::c_uint = 6;
pub const ZSTD_BLOCKSIZE_ABSOLUTEMAX: ::libc::c_uint = 131072;
pub type wchar_t = ::libc::c_int;
extern "C" {
pub fn ZSTD_versionNumber() -> ::libc::c_uint;
}
extern "C" {
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" {
pub fn ZSTD_decompress(dst: *mut ::libc::c_void, dstCapacity: usize,
src: *const ::libc::c_void, compressedSize: usize)
-> usize;
}
extern "C" {
pub fn ZSTD_getDecompressedSize(src: *const ::libc::c_void,
srcSize: usize)
-> ::libc::c_ulonglong;
}
extern "C" {
pub fn ZSTD_maxCLevel() -> ::libc::c_int;
}
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;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_CCtx_s {
_unused: [u8; 0],
}
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" {
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" {
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" {
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" {
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],
}
pub type ZSTD_CDict = ZSTD_CDict_s;
extern "C" {
pub fn ZSTD_createCDict(dictBuffer: *const ::libc::c_void,
dictSize: usize, compressionLevel: ::libc::c_int)
-> *mut ZSTD_CDict;
}
extern "C" {
pub fn ZSTD_freeCDict(CDict: *mut ZSTD_CDict) -> usize;
}
extern "C" {
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" {
pub fn ZSTD_createDDict(dictBuffer: *const ::libc::c_void,
dictSize: usize)
-> *mut ZSTD_DDict;
}
extern "C" {
pub fn ZSTD_freeDDict(ddict: *mut ZSTD_DDict) -> usize;
}
extern "C" {
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;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ZSTD_inBuffer_s {
pub src: *const ::libc::c_void,
pub size: usize,
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 {
&(*(0 as *const ZSTD_inBuffer_s)).src as *const _ as usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_inBuffer_s),
"::",
stringify!(src)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_inBuffer_s)).size as *const _ as usize
},
8usize,
concat!("Alignment of field: ",
stringify!(ZSTD_inBuffer_s),
"::",
stringify!(size)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_inBuffer_s)).pos as *const _ as usize
},
16usize,
concat!("Alignment of field: ",
stringify!(ZSTD_inBuffer_s),
"::",
stringify!(pos)));
}
impl Clone for ZSTD_inBuffer_s {
fn clone(&self) -> Self {
*self
}
}
pub type ZSTD_inBuffer = ZSTD_inBuffer_s;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ZSTD_outBuffer_s {
pub dst: *mut ::libc::c_void,
pub size: usize,
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 {
&(*(0 as *const ZSTD_outBuffer_s)).dst as *const _ as usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_outBuffer_s),
"::",
stringify!(dst)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_outBuffer_s)).size as *const _ as usize
},
8usize,
concat!("Alignment of field: ",
stringify!(ZSTD_outBuffer_s),
"::",
stringify!(size)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_outBuffer_s)).pos as *const _ as usize
},
16usize,
concat!("Alignment of field: ",
stringify!(ZSTD_outBuffer_s),
"::",
stringify!(pos)));
}
impl Clone for ZSTD_outBuffer_s {
fn clone(&self) -> Self {
*self
}
}
pub type ZSTD_outBuffer = ZSTD_outBuffer_s;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_CStream_s {
_unused: [u8; 0],
}
pub type ZSTD_CStream = ZSTD_CStream_s;
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;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ZSTD_DStream_s {
_unused: [u8; 0],
}
pub type ZSTD_DStream = ZSTD_DStream_s;
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;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ZSTD_strategy {
ZSTD_fast = 0,
ZSTD_dfast = 1,
ZSTD_greedy = 2,
ZSTD_lazy = 3,
ZSTD_lazy2 = 4,
ZSTD_btlazy2 = 5,
ZSTD_btopt = 6,
ZSTD_btopt2 = 7,
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ZSTD_compressionParameters {
pub windowLog: ::libc::c_uint,
pub chainLog: ::libc::c_uint,
pub hashLog: ::libc::c_uint,
pub searchLog: ::libc::c_uint,
pub searchLength: ::libc::c_uint,
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 {
&(*(0 as *const ZSTD_compressionParameters)).windowLog as
*const _ as usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(windowLog)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_compressionParameters)).chainLog as
*const _ as usize
},
4usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(chainLog)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_compressionParameters)).hashLog as
*const _ as usize
},
8usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(hashLog)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_compressionParameters)).searchLog as
*const _ as usize
},
12usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(searchLog)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_compressionParameters)).searchLength as
*const _ as usize
},
16usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(searchLength)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_compressionParameters)).targetLength as
*const _ as usize
},
20usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(targetLength)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_compressionParameters)).strategy as
*const _ as usize
},
24usize,
concat!("Alignment of field: ",
stringify!(ZSTD_compressionParameters),
"::",
stringify!(strategy)));
}
impl Clone for ZSTD_compressionParameters {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ZSTD_frameParameters {
pub contentSizeFlag: ::libc::c_uint,
pub checksumFlag: ::libc::c_uint,
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 {
&(*(0 as *const ZSTD_frameParameters)).contentSizeFlag as
*const _ as usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParameters),
"::",
stringify!(contentSizeFlag)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_frameParameters)).checksumFlag as
*const _ as usize
},
4usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParameters),
"::",
stringify!(checksumFlag)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_frameParameters)).noDictIDFlag as
*const _ as usize
},
8usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParameters),
"::",
stringify!(noDictIDFlag)));
}
impl Clone for ZSTD_frameParameters {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[derive(Debug, Copy)]
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 {
&(*(0 as *const ZSTD_parameters)).cParams as *const _ as
usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_parameters),
"::",
stringify!(cParams)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_parameters)).fParams as *const _ as
usize
},
28usize,
concat!("Alignment of field: ",
stringify!(ZSTD_parameters),
"::",
stringify!(fParams)));
}
impl Clone for ZSTD_parameters {
fn clone(&self) -> Self {
*self
}
}
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)]
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 {
&(*(0 as *const ZSTD_customMem)).customAlloc as *const _ as
usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_customMem),
"::",
stringify!(customAlloc)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_customMem)).customFree as *const _ as
usize
},
8usize,
concat!("Alignment of field: ",
stringify!(ZSTD_customMem),
"::",
stringify!(customFree)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_customMem)).opaque as *const _ as usize
},
16usize,
concat!("Alignment of field: ",
stringify!(ZSTD_customMem),
"::",
stringify!(opaque)));
}
impl Clone for ZSTD_customMem {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
pub fn ZSTD_findFrameCompressedSize(src: *const ::libc::c_void,
srcSize: usize)
-> usize;
}
extern "C" {
pub fn ZSTD_getFrameContentSize(src: *const ::libc::c_void,
srcSize: usize)
-> ::libc::c_ulonglong;
}
extern "C" {
pub fn ZSTD_findDecompressedSize(src: *const ::libc::c_void,
srcSize: usize)
-> ::libc::c_ulonglong;
}
extern "C" {
pub fn ZSTD_estimateCCtxSize(cParams: ZSTD_compressionParameters)
-> usize;
}
extern "C" {
pub fn ZSTD_createCCtx_advanced(customMem: ZSTD_customMem)
-> *mut ZSTD_CCtx;
}
extern "C" {
pub fn ZSTD_sizeof_CCtx(cctx: *const ZSTD_CCtx) -> usize;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ZSTD_CCtxParameter {
ZSTD_p_forceWindow = 0,
ZSTD_p_forceRawDict = 1,
}
extern "C" {
pub fn ZSTD_setCCtxParameter(cctx: *mut ZSTD_CCtx,
param: ZSTD_CCtxParameter,
value: ::libc::c_uint)
-> usize;
}
extern "C" {
pub fn ZSTD_createCDict_byReference(dictBuffer: *const ::libc::c_void,
dictSize: usize,
compressionLevel: ::libc::c_int)
-> *mut ZSTD_CDict;
}
extern "C" {
pub fn ZSTD_createCDict_advanced(dict: *const ::libc::c_void,
dictSize: usize,
byReference: ::libc::c_uint,
cParams: ZSTD_compressionParameters,
customMem: ZSTD_customMem)
-> *mut ZSTD_CDict;
}
extern "C" {
pub fn ZSTD_sizeof_CDict(cdict: *const ZSTD_CDict) -> usize;
}
extern "C" {
pub fn ZSTD_getCParams(compressionLevel: ::libc::c_int,
estimatedSrcSize: ::libc::c_ulonglong,
dictSize: usize)
-> ZSTD_compressionParameters;
}
extern "C" {
pub fn ZSTD_getParams(compressionLevel: ::libc::c_int,
estimatedSrcSize: ::libc::c_ulonglong,
dictSize: usize)
-> ZSTD_parameters;
}
extern "C" {
pub fn ZSTD_checkCParams(params: ZSTD_compressionParameters) -> usize;
}
extern "C" {
pub fn ZSTD_adjustCParams(cPar: ZSTD_compressionParameters,
srcSize: ::libc::c_ulonglong, dictSize: usize)
-> ZSTD_compressionParameters;
}
extern "C" {
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" {
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" {
pub fn ZSTD_isFrame(buffer: *const ::libc::c_void, size: usize)
-> ::libc::c_uint;
}
extern "C" {
pub fn ZSTD_estimateDCtxSize() -> usize;
}
extern "C" {
pub fn ZSTD_createDCtx_advanced(customMem: ZSTD_customMem)
-> *mut ZSTD_DCtx;
}
extern "C" {
pub fn ZSTD_sizeof_DCtx(dctx: *const ZSTD_DCtx) -> usize;
}
extern "C" {
pub fn ZSTD_createDDict_byReference(dictBuffer: *const ::libc::c_void,
dictSize: usize)
-> *mut ZSTD_DDict;
}
extern "C" {
pub fn ZSTD_createDDict_advanced(dict: *const ::libc::c_void,
dictSize: usize,
byReference: ::libc::c_uint,
customMem: ZSTD_customMem)
-> *mut ZSTD_DDict;
}
extern "C" {
pub fn ZSTD_sizeof_DDict(ddict: *const ZSTD_DDict) -> usize;
}
extern "C" {
pub fn ZSTD_getDictID_fromDict(dict: *const ::libc::c_void,
dictSize: usize)
-> ::libc::c_uint;
}
extern "C" {
pub fn ZSTD_getDictID_fromDDict(ddict: *const ZSTD_DDict)
-> ::libc::c_uint;
}
extern "C" {
pub fn ZSTD_getDictID_fromFrame(src: *const ::libc::c_void,
srcSize: usize)
-> ::libc::c_uint;
}
extern "C" {
pub fn ZSTD_createCStream_advanced(customMem: ZSTD_customMem)
-> *mut ZSTD_CStream;
}
extern "C" {
pub fn ZSTD_sizeof_CStream(zcs: *const ZSTD_CStream) -> usize;
}
extern "C" {
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,
pledgedSrcSize:
::libc::c_ulonglong,
fParams: ZSTD_frameParameters)
-> usize;
}
extern "C" {
pub fn ZSTD_resetCStream(zcs: *mut ZSTD_CStream,
pledgedSrcSize: ::libc::c_ulonglong)
-> usize;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ZSTD_DStreamParameter_e {
DStream_p_maxWindowSize = 0,
}
extern "C" {
pub fn ZSTD_createDStream_advanced(customMem: ZSTD_customMem)
-> *mut ZSTD_DStream;
}
extern "C" {
pub fn ZSTD_initDStream_usingDict(zds: *mut ZSTD_DStream,
dict: *const ::libc::c_void,
dictSize: usize)
-> usize;
}
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_usingDDict(zds: *mut ZSTD_DStream,
ddict: *const ZSTD_DDict)
-> usize;
}
extern "C" {
pub fn ZSTD_resetDStream(zds: *mut ZSTD_DStream) -> usize;
}
extern "C" {
pub fn ZSTD_sizeof_DStream(zds: *const ZSTD_DStream) -> usize;
}
extern "C" {
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;
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct ZSTD_frameParams {
pub frameContentSize: ::libc::c_ulonglong,
pub windowSize: ::libc::c_uint,
pub dictID: ::libc::c_uint,
pub checksumFlag: ::libc::c_uint,
}
#[test]
fn bindgen_test_layout_ZSTD_frameParams() {
assert_eq!(::core::mem::size_of::<ZSTD_frameParams>(),
24usize,
concat!("Size of: ", stringify!(ZSTD_frameParams)));
assert_eq!(::core::mem::align_of::<ZSTD_frameParams>(),
8usize,
concat!("Alignment of ", stringify!(ZSTD_frameParams)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_frameParams)).frameContentSize as
*const _ as usize
},
0usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParams),
"::",
stringify!(frameContentSize)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_frameParams)).windowSize as
*const _ as usize
},
8usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParams),
"::",
stringify!(windowSize)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_frameParams)).dictID as *const _ as
usize
},
12usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParams),
"::",
stringify!(dictID)));
assert_eq!(unsafe {
&(*(0 as *const ZSTD_frameParams)).checksumFlag as
*const _ as usize
},
16usize,
concat!("Alignment of field: ",
stringify!(ZSTD_frameParams),
"::",
stringify!(checksumFlag)));
}
impl Clone for ZSTD_frameParams {
fn clone(&self) -> Self {
*self
}
}
extern "C" {
pub fn ZSTD_getFrameParams(fparamsPtr: *mut ZSTD_frameParams,
src: *const ::libc::c_void, srcSize: usize)
-> 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_copyDCtx(dctx: *mut ZSTD_DCtx,
preparedDCtx: *const ZSTD_DCtx);
}
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;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ZSTD_nextInputType_e {
ZSTDnit_frameHeader = 0,
ZSTDnit_blockHeader = 1,
ZSTDnit_block = 2,
ZSTDnit_lastBlock = 3,
ZSTDnit_checksum = 4,
ZSTDnit_skippableFrame = 5,
}
extern "C" {
pub fn ZSTD_nextInputType(dctx: *mut ZSTD_DCtx) -> ZSTD_nextInputType_e;
}
extern "C" {
pub fn ZSTD_getBlockSizeMax(cctx: *mut 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" {
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;
}