-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathLibZstd_clang_static.jl
1223 lines (903 loc) · 42.8 KB
/
LibZstd_clang_static.jl
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
module LibZstdStatic
using Zstd_jll
export Zstd_jll
const INT_MAX = typemax(Cint)
const size_t = Int64
ZSTD_EXPAND_AND_QUOTE(expr) = string(expr)
function ZDICT_trainFromBuffer(dictBuffer, dictBufferCapacity, samplesBuffer, samplesSizes, nbSamples)
ccall((:ZDICT_trainFromBuffer, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Ptr{Csize_t}, Cuint), dictBuffer, dictBufferCapacity, samplesBuffer, samplesSizes, nbSamples)
end
struct ZDICT_params_t
compressionLevel::Cint
notificationLevel::Cuint
dictID::Cuint
end
function ZDICT_finalizeDictionary(dstDictBuffer, maxDictSize, dictContent, dictContentSize, samplesBuffer, samplesSizes, nbSamples, parameters)
ccall((:ZDICT_finalizeDictionary, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Ptr{Csize_t}, Cuint, ZDICT_params_t), dstDictBuffer, maxDictSize, dictContent, dictContentSize, samplesBuffer, samplesSizes, nbSamples, parameters)
end
function ZDICT_getDictID(dictBuffer, dictSize)
ccall((:ZDICT_getDictID, libzstd), Cuint, (Ptr{Cvoid}, Csize_t), dictBuffer, dictSize)
end
function ZDICT_getDictHeaderSize(dictBuffer, dictSize)
ccall((:ZDICT_getDictHeaderSize, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t), dictBuffer, dictSize)
end
function ZDICT_isError(errorCode)
ccall((:ZDICT_isError, libzstd), Cuint, (Csize_t,), errorCode)
end
function ZDICT_getErrorName(errorCode)
ccall((:ZDICT_getErrorName, libzstd), Ptr{Cchar}, (Csize_t,), errorCode)
end
function ZSTD_versionNumber()
ccall((:ZSTD_versionNumber, libzstd), Cuint, ())
end
function ZSTD_versionString()
ccall((:ZSTD_versionString, libzstd), Ptr{Cchar}, ())
end
function ZSTD_compress(dst, dstCapacity, src, srcSize, compressionLevel)
ccall((:ZSTD_compress, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Cint), dst, dstCapacity, src, srcSize, compressionLevel)
end
function ZSTD_decompress(dst, dstCapacity, src, compressedSize)
ccall((:ZSTD_decompress, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), dst, dstCapacity, src, compressedSize)
end
function ZSTD_getFrameContentSize(src, srcSize)
ccall((:ZSTD_getFrameContentSize, libzstd), Culonglong, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_getDecompressedSize(src, srcSize)
ccall((:ZSTD_getDecompressedSize, libzstd), Culonglong, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_findFrameCompressedSize(src, srcSize)
ccall((:ZSTD_findFrameCompressedSize, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_compressBound(srcSize)
ccall((:ZSTD_compressBound, libzstd), Csize_t, (Csize_t,), srcSize)
end
function ZSTD_isError(code)
ccall((:ZSTD_isError, libzstd), Cuint, (Csize_t,), code)
end
function ZSTD_getErrorName(code)
ccall((:ZSTD_getErrorName, libzstd), Ptr{Cchar}, (Csize_t,), code)
end
function ZSTD_minCLevel()
ccall((:ZSTD_minCLevel, libzstd), Cint, ())
end
function ZSTD_maxCLevel()
ccall((:ZSTD_maxCLevel, libzstd), Cint, ())
end
function ZSTD_defaultCLevel()
ccall((:ZSTD_defaultCLevel, libzstd), Cint, ())
end
mutable struct ZSTD_CCtx_s end
const ZSTD_CCtx = ZSTD_CCtx_s
function ZSTD_createCCtx()
ccall((:ZSTD_createCCtx, libzstd), Ptr{ZSTD_CCtx}, ())
end
function ZSTD_freeCCtx(cctx)
ccall((:ZSTD_freeCCtx, libzstd), Csize_t, (Ptr{ZSTD_CCtx},), cctx)
end
function ZSTD_compressCCtx(cctx, dst, dstCapacity, src, srcSize, compressionLevel)
ccall((:ZSTD_compressCCtx, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Cint), cctx, dst, dstCapacity, src, srcSize, compressionLevel)
end
mutable struct ZSTD_DCtx_s end
const ZSTD_DCtx = ZSTD_DCtx_s
function ZSTD_createDCtx()
ccall((:ZSTD_createDCtx, libzstd), Ptr{ZSTD_DCtx}, ())
end
function ZSTD_freeDCtx(dctx)
ccall((:ZSTD_freeDCtx, libzstd), Csize_t, (Ptr{ZSTD_DCtx},), dctx)
end
function ZSTD_decompressDCtx(dctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_decompressDCtx, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), dctx, dst, dstCapacity, src, srcSize)
end
@enum ZSTD_strategy::UInt32 begin
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
end
@enum ZSTD_cParameter::UInt32 begin
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_targetCBlockSize = 130
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_experimentalParam7 = 1004
ZSTD_c_experimentalParam8 = 1005
ZSTD_c_experimentalParam9 = 1006
ZSTD_c_experimentalParam10 = 1007
ZSTD_c_experimentalParam11 = 1008
ZSTD_c_experimentalParam12 = 1009
ZSTD_c_experimentalParam13 = 1010
ZSTD_c_experimentalParam14 = 1011
ZSTD_c_experimentalParam15 = 1012
ZSTD_c_experimentalParam16 = 1013
ZSTD_c_experimentalParam17 = 1014
ZSTD_c_experimentalParam18 = 1015
ZSTD_c_experimentalParam19 = 1016
end
struct ZSTD_bounds
error::Csize_t
lowerBound::Cint
upperBound::Cint
end
function ZSTD_cParam_getBounds(cParam)
ccall((:ZSTD_cParam_getBounds, libzstd), ZSTD_bounds, (ZSTD_cParameter,), cParam)
end
function ZSTD_CCtx_setParameter(cctx, param, value)
ccall((:ZSTD_CCtx_setParameter, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, ZSTD_cParameter, Cint), cctx, param, value)
end
function ZSTD_CCtx_setPledgedSrcSize(cctx, pledgedSrcSize)
ccall((:ZSTD_CCtx_setPledgedSrcSize, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Culonglong), cctx, pledgedSrcSize)
end
@enum ZSTD_ResetDirective::UInt32 begin
ZSTD_reset_session_only = 1
ZSTD_reset_parameters = 2
ZSTD_reset_session_and_parameters = 3
end
function ZSTD_CCtx_reset(cctx, reset)
ccall((:ZSTD_CCtx_reset, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, ZSTD_ResetDirective), cctx, reset)
end
function ZSTD_compress2(cctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_compress2, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), cctx, dst, dstCapacity, src, srcSize)
end
@enum ZSTD_dParameter::UInt32 begin
ZSTD_d_windowLogMax = 100
ZSTD_d_experimentalParam1 = 1000
ZSTD_d_experimentalParam2 = 1001
ZSTD_d_experimentalParam3 = 1002
ZSTD_d_experimentalParam4 = 1003
ZSTD_d_experimentalParam5 = 1004
ZSTD_d_experimentalParam6 = 1005
end
function ZSTD_dParam_getBounds(dParam)
ccall((:ZSTD_dParam_getBounds, libzstd), ZSTD_bounds, (ZSTD_dParameter,), dParam)
end
function ZSTD_DCtx_setParameter(dctx, param, value)
ccall((:ZSTD_DCtx_setParameter, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, ZSTD_dParameter, Cint), dctx, param, value)
end
function ZSTD_DCtx_reset(dctx, reset)
ccall((:ZSTD_DCtx_reset, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, ZSTD_ResetDirective), dctx, reset)
end
mutable struct ZSTD_inBuffer_s
src::Ptr{Cvoid}
size::Csize_t
pos::Csize_t
end
const ZSTD_inBuffer = ZSTD_inBuffer_s
mutable struct ZSTD_outBuffer_s
dst::Ptr{Cvoid}
size::Csize_t
pos::Csize_t
end
const ZSTD_outBuffer = ZSTD_outBuffer_s
const ZSTD_CStream = ZSTD_CCtx
function ZSTD_createCStream()
ccall((:ZSTD_createCStream, libzstd), Ptr{ZSTD_CStream}, ())
end
function ZSTD_freeCStream(zcs)
ccall((:ZSTD_freeCStream, libzstd), Csize_t, (Ptr{ZSTD_CStream},), zcs)
end
@enum ZSTD_EndDirective::UInt32 begin
ZSTD_e_continue = 0
ZSTD_e_flush = 1
ZSTD_e_end = 2
end
function ZSTD_compressStream2(cctx, output, input, endOp)
ccall((:ZSTD_compressStream2, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_outBuffer}, Ptr{ZSTD_inBuffer}, ZSTD_EndDirective), cctx, output, input, endOp)
end
function ZSTD_CStreamInSize()
ccall((:ZSTD_CStreamInSize, libzstd), Csize_t, ())
end
function ZSTD_CStreamOutSize()
ccall((:ZSTD_CStreamOutSize, libzstd), Csize_t, ())
end
function ZSTD_initCStream(zcs, compressionLevel)
ccall((:ZSTD_initCStream, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Cint), zcs, compressionLevel)
end
function ZSTD_compressStream(zcs, output, input)
ccall((:ZSTD_compressStream, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{ZSTD_outBuffer}, Ptr{ZSTD_inBuffer}), zcs, output, input)
end
function ZSTD_flushStream(zcs, output)
ccall((:ZSTD_flushStream, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{ZSTD_outBuffer}), zcs, output)
end
function ZSTD_endStream(zcs, output)
ccall((:ZSTD_endStream, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{ZSTD_outBuffer}), zcs, output)
end
const ZSTD_DStream = ZSTD_DCtx
function ZSTD_createDStream()
ccall((:ZSTD_createDStream, libzstd), Ptr{ZSTD_DStream}, ())
end
function ZSTD_freeDStream(zds)
ccall((:ZSTD_freeDStream, libzstd), Csize_t, (Ptr{ZSTD_DStream},), zds)
end
function ZSTD_initDStream(zds)
ccall((:ZSTD_initDStream, libzstd), Csize_t, (Ptr{ZSTD_DStream},), zds)
end
function ZSTD_decompressStream(zds, output, input)
ccall((:ZSTD_decompressStream, libzstd), Csize_t, (Ptr{ZSTD_DStream}, Ptr{ZSTD_outBuffer}, Ptr{ZSTD_inBuffer}), zds, output, input)
end
function ZSTD_DStreamInSize()
ccall((:ZSTD_DStreamInSize, libzstd), Csize_t, ())
end
function ZSTD_DStreamOutSize()
ccall((:ZSTD_DStreamOutSize, libzstd), Csize_t, ())
end
function ZSTD_compress_usingDict(ctx, dst, dstCapacity, src, srcSize, dict, dictSize, compressionLevel)
ccall((:ZSTD_compress_usingDict, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Cint), ctx, dst, dstCapacity, src, srcSize, dict, dictSize, compressionLevel)
end
function ZSTD_decompress_usingDict(dctx, dst, dstCapacity, src, srcSize, dict, dictSize)
ccall((:ZSTD_decompress_usingDict, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), dctx, dst, dstCapacity, src, srcSize, dict, dictSize)
end
mutable struct ZSTD_CDict_s end
const ZSTD_CDict = ZSTD_CDict_s
function ZSTD_createCDict(dictBuffer, dictSize, compressionLevel)
ccall((:ZSTD_createCDict, libzstd), Ptr{ZSTD_CDict}, (Ptr{Cvoid}, Csize_t, Cint), dictBuffer, dictSize, compressionLevel)
end
function ZSTD_freeCDict(CDict)
ccall((:ZSTD_freeCDict, libzstd), Csize_t, (Ptr{ZSTD_CDict},), CDict)
end
function ZSTD_compress_usingCDict(cctx, dst, dstCapacity, src, srcSize, cdict)
ccall((:ZSTD_compress_usingCDict, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{ZSTD_CDict}), cctx, dst, dstCapacity, src, srcSize, cdict)
end
mutable struct ZSTD_DDict_s end
const ZSTD_DDict = ZSTD_DDict_s
function ZSTD_createDDict(dictBuffer, dictSize)
ccall((:ZSTD_createDDict, libzstd), Ptr{ZSTD_DDict}, (Ptr{Cvoid}, Csize_t), dictBuffer, dictSize)
end
function ZSTD_freeDDict(ddict)
ccall((:ZSTD_freeDDict, libzstd), Csize_t, (Ptr{ZSTD_DDict},), ddict)
end
function ZSTD_decompress_usingDDict(dctx, dst, dstCapacity, src, srcSize, ddict)
ccall((:ZSTD_decompress_usingDDict, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{ZSTD_DDict}), dctx, dst, dstCapacity, src, srcSize, ddict)
end
function ZSTD_getDictID_fromDict(dict, dictSize)
ccall((:ZSTD_getDictID_fromDict, libzstd), Cuint, (Ptr{Cvoid}, Csize_t), dict, dictSize)
end
function ZSTD_getDictID_fromCDict(cdict)
ccall((:ZSTD_getDictID_fromCDict, libzstd), Cuint, (Ptr{ZSTD_CDict},), cdict)
end
function ZSTD_getDictID_fromDDict(ddict)
ccall((:ZSTD_getDictID_fromDDict, libzstd), Cuint, (Ptr{ZSTD_DDict},), ddict)
end
function ZSTD_getDictID_fromFrame(src, srcSize)
ccall((:ZSTD_getDictID_fromFrame, libzstd), Cuint, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_CCtx_loadDictionary(cctx, dict, dictSize)
ccall((:ZSTD_CCtx_loadDictionary, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t), cctx, dict, dictSize)
end
function ZSTD_CCtx_refCDict(cctx, cdict)
ccall((:ZSTD_CCtx_refCDict, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_CDict}), cctx, cdict)
end
function ZSTD_CCtx_refPrefix(cctx, prefix, prefixSize)
ccall((:ZSTD_CCtx_refPrefix, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t), cctx, prefix, prefixSize)
end
function ZSTD_DCtx_loadDictionary(dctx, dict, dictSize)
ccall((:ZSTD_DCtx_loadDictionary, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t), dctx, dict, dictSize)
end
function ZSTD_DCtx_refDDict(dctx, ddict)
ccall((:ZSTD_DCtx_refDDict, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{ZSTD_DDict}), dctx, ddict)
end
function ZSTD_DCtx_refPrefix(dctx, prefix, prefixSize)
ccall((:ZSTD_DCtx_refPrefix, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t), dctx, prefix, prefixSize)
end
function ZSTD_sizeof_CCtx(cctx)
ccall((:ZSTD_sizeof_CCtx, libzstd), Csize_t, (Ptr{ZSTD_CCtx},), cctx)
end
function ZSTD_sizeof_DCtx(dctx)
ccall((:ZSTD_sizeof_DCtx, libzstd), Csize_t, (Ptr{ZSTD_DCtx},), dctx)
end
function ZSTD_sizeof_CStream(zcs)
ccall((:ZSTD_sizeof_CStream, libzstd), Csize_t, (Ptr{ZSTD_CStream},), zcs)
end
function ZSTD_sizeof_DStream(zds)
ccall((:ZSTD_sizeof_DStream, libzstd), Csize_t, (Ptr{ZSTD_DStream},), zds)
end
function ZSTD_sizeof_CDict(cdict)
ccall((:ZSTD_sizeof_CDict, libzstd), Csize_t, (Ptr{ZSTD_CDict},), cdict)
end
function ZSTD_sizeof_DDict(ddict)
ccall((:ZSTD_sizeof_DDict, libzstd), Csize_t, (Ptr{ZSTD_DDict},), ddict)
end
mutable struct ZSTD_CCtx_params_s end
const ZSTD_CCtx_params = ZSTD_CCtx_params_s
struct ZSTD_Sequence
offset::Cuint
litLength::Cuint
matchLength::Cuint
rep::Cuint
end
struct ZSTD_compressionParameters
windowLog::Cuint
chainLog::Cuint
hashLog::Cuint
searchLog::Cuint
minMatch::Cuint
targetLength::Cuint
strategy::ZSTD_strategy
end
struct ZSTD_frameParameters
contentSizeFlag::Cint
checksumFlag::Cint
noDictIDFlag::Cint
end
struct ZSTD_parameters
cParams::ZSTD_compressionParameters
fParams::ZSTD_frameParameters
end
@enum ZSTD_dictContentType_e::UInt32 begin
ZSTD_dct_auto = 0
ZSTD_dct_rawContent = 1
ZSTD_dct_fullDict = 2
end
@enum ZSTD_dictLoadMethod_e::UInt32 begin
ZSTD_dlm_byCopy = 0
ZSTD_dlm_byRef = 1
end
@enum ZSTD_format_e::UInt32 begin
ZSTD_f_zstd1 = 0
ZSTD_f_zstd1_magicless = 1
end
@enum ZSTD_forceIgnoreChecksum_e::UInt32 begin
ZSTD_d_validateChecksum = 0
ZSTD_d_ignoreChecksum = 1
end
@enum ZSTD_refMultipleDDicts_e::UInt32 begin
ZSTD_rmd_refSingleDDict = 0
ZSTD_rmd_refMultipleDDicts = 1
end
@enum ZSTD_dictAttachPref_e::UInt32 begin
ZSTD_dictDefaultAttach = 0
ZSTD_dictForceAttach = 1
ZSTD_dictForceCopy = 2
ZSTD_dictForceLoad = 3
end
@enum ZSTD_literalCompressionMode_e::UInt32 begin
ZSTD_lcm_auto = 0
ZSTD_lcm_huffman = 1
ZSTD_lcm_uncompressed = 2
end
@enum ZSTD_paramSwitch_e::UInt32 begin
ZSTD_ps_auto = 0
ZSTD_ps_enable = 1
ZSTD_ps_disable = 2
end
function ZSTD_findDecompressedSize(src, srcSize)
ccall((:ZSTD_findDecompressedSize, libzstd), Culonglong, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_decompressBound(src, srcSize)
ccall((:ZSTD_decompressBound, libzstd), Culonglong, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_frameHeaderSize(src, srcSize)
ccall((:ZSTD_frameHeaderSize, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
@enum ZSTD_frameType_e::UInt32 begin
ZSTD_frame = 0
ZSTD_skippableFrame = 1
end
struct ZSTD_frameHeader
frameContentSize::Culonglong
windowSize::Culonglong
blockSizeMax::Cuint
frameType::ZSTD_frameType_e
headerSize::Cuint
dictID::Cuint
checksumFlag::Cuint
_reserved1::Cuint
_reserved2::Cuint
end
function ZSTD_getFrameHeader(zfhPtr, src, srcSize)
ccall((:ZSTD_getFrameHeader, libzstd), Csize_t, (Ptr{ZSTD_frameHeader}, Ptr{Cvoid}, Csize_t), zfhPtr, src, srcSize)
end
function ZSTD_getFrameHeader_advanced(zfhPtr, src, srcSize, format)
ccall((:ZSTD_getFrameHeader_advanced, libzstd), Csize_t, (Ptr{ZSTD_frameHeader}, Ptr{Cvoid}, Csize_t, ZSTD_format_e), zfhPtr, src, srcSize, format)
end
function ZSTD_decompressionMargin(src, srcSize)
ccall((:ZSTD_decompressionMargin, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
@enum ZSTD_sequenceFormat_e::UInt32 begin
ZSTD_sf_noBlockDelimiters = 0
ZSTD_sf_explicitBlockDelimiters = 1
end
function ZSTD_sequenceBound(srcSize)
ccall((:ZSTD_sequenceBound, libzstd), Csize_t, (Csize_t,), srcSize)
end
function ZSTD_generateSequences(zc, outSeqs, outSeqsSize, src, srcSize)
ccall((:ZSTD_generateSequences, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_Sequence}, Csize_t, Ptr{Cvoid}, Csize_t), zc, outSeqs, outSeqsSize, src, srcSize)
end
function ZSTD_mergeBlockDelimiters(sequences, seqsSize)
ccall((:ZSTD_mergeBlockDelimiters, libzstd), Csize_t, (Ptr{ZSTD_Sequence}, Csize_t), sequences, seqsSize)
end
function ZSTD_compressSequences(cctx, dst, dstSize, inSeqs, inSeqsSize, src, srcSize)
ccall((:ZSTD_compressSequences, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{ZSTD_Sequence}, Csize_t, Ptr{Cvoid}, Csize_t), cctx, dst, dstSize, inSeqs, inSeqsSize, src, srcSize)
end
function ZSTD_writeSkippableFrame(dst, dstCapacity, src, srcSize, magicVariant)
ccall((:ZSTD_writeSkippableFrame, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Cuint), dst, dstCapacity, src, srcSize, magicVariant)
end
function ZSTD_readSkippableFrame(dst, dstCapacity, magicVariant, src, srcSize)
ccall((:ZSTD_readSkippableFrame, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t, Ptr{Cuint}, Ptr{Cvoid}, Csize_t), dst, dstCapacity, magicVariant, src, srcSize)
end
function ZSTD_isSkippableFrame(buffer, size)
ccall((:ZSTD_isSkippableFrame, libzstd), Cuint, (Ptr{Cvoid}, Csize_t), buffer, size)
end
function ZSTD_estimateCCtxSize(maxCompressionLevel)
ccall((:ZSTD_estimateCCtxSize, libzstd), Csize_t, (Cint,), maxCompressionLevel)
end
function ZSTD_estimateCCtxSize_usingCParams(cParams)
ccall((:ZSTD_estimateCCtxSize_usingCParams, libzstd), Csize_t, (ZSTD_compressionParameters,), cParams)
end
function ZSTD_estimateCCtxSize_usingCCtxParams(params)
ccall((:ZSTD_estimateCCtxSize_usingCCtxParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params},), params)
end
function ZSTD_estimateDCtxSize()
ccall((:ZSTD_estimateDCtxSize, libzstd), Csize_t, ())
end
function ZSTD_estimateCStreamSize(maxCompressionLevel)
ccall((:ZSTD_estimateCStreamSize, libzstd), Csize_t, (Cint,), maxCompressionLevel)
end
function ZSTD_estimateCStreamSize_usingCParams(cParams)
ccall((:ZSTD_estimateCStreamSize_usingCParams, libzstd), Csize_t, (ZSTD_compressionParameters,), cParams)
end
function ZSTD_estimateCStreamSize_usingCCtxParams(params)
ccall((:ZSTD_estimateCStreamSize_usingCCtxParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params},), params)
end
function ZSTD_estimateDStreamSize(maxWindowSize)
ccall((:ZSTD_estimateDStreamSize, libzstd), Csize_t, (Csize_t,), maxWindowSize)
end
function ZSTD_estimateDStreamSize_fromFrame(src, srcSize)
ccall((:ZSTD_estimateDStreamSize_fromFrame, libzstd), Csize_t, (Ptr{Cvoid}, Csize_t), src, srcSize)
end
function ZSTD_estimateCDictSize(dictSize, compressionLevel)
ccall((:ZSTD_estimateCDictSize, libzstd), Csize_t, (Csize_t, Cint), dictSize, compressionLevel)
end
function ZSTD_estimateCDictSize_advanced(dictSize, cParams, dictLoadMethod)
ccall((:ZSTD_estimateCDictSize_advanced, libzstd), Csize_t, (Csize_t, ZSTD_compressionParameters, ZSTD_dictLoadMethod_e), dictSize, cParams, dictLoadMethod)
end
function ZSTD_estimateDDictSize(dictSize, dictLoadMethod)
ccall((:ZSTD_estimateDDictSize, libzstd), Csize_t, (Csize_t, ZSTD_dictLoadMethod_e), dictSize, dictLoadMethod)
end
function ZSTD_initStaticCCtx(workspace, workspaceSize)
ccall((:ZSTD_initStaticCCtx, libzstd), Ptr{ZSTD_CCtx}, (Ptr{Cvoid}, Csize_t), workspace, workspaceSize)
end
function ZSTD_initStaticCStream(workspace, workspaceSize)
ccall((:ZSTD_initStaticCStream, libzstd), Ptr{ZSTD_CStream}, (Ptr{Cvoid}, Csize_t), workspace, workspaceSize)
end
function ZSTD_initStaticDCtx(workspace, workspaceSize)
ccall((:ZSTD_initStaticDCtx, libzstd), Ptr{ZSTD_DCtx}, (Ptr{Cvoid}, Csize_t), workspace, workspaceSize)
end
function ZSTD_initStaticDStream(workspace, workspaceSize)
ccall((:ZSTD_initStaticDStream, libzstd), Ptr{ZSTD_DStream}, (Ptr{Cvoid}, Csize_t), workspace, workspaceSize)
end
function ZSTD_initStaticCDict(workspace, workspaceSize, dict, dictSize, dictLoadMethod, dictContentType, cParams)
ccall((:ZSTD_initStaticCDict, libzstd), Ptr{ZSTD_CDict}, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e, ZSTD_compressionParameters), workspace, workspaceSize, dict, dictSize, dictLoadMethod, dictContentType, cParams)
end
function ZSTD_initStaticDDict(workspace, workspaceSize, dict, dictSize, dictLoadMethod, dictContentType)
ccall((:ZSTD_initStaticDDict, libzstd), Ptr{ZSTD_DDict}, (Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e), workspace, workspaceSize, dict, dictSize, dictLoadMethod, dictContentType)
end
# typedef void * ( * ZSTD_allocFunction ) ( void * opaque , size_t size )
const ZSTD_allocFunction = Ptr{Cvoid}
# typedef void ( * ZSTD_freeFunction ) ( void * opaque , void * address )
const ZSTD_freeFunction = Ptr{Cvoid}
struct ZSTD_customMem
customAlloc::ZSTD_allocFunction
customFree::ZSTD_freeFunction
opaque::Ptr{Cvoid}
end
function ZSTD_createCCtx_advanced(customMem)
ccall((:ZSTD_createCCtx_advanced, libzstd), Ptr{ZSTD_CCtx}, (ZSTD_customMem,), customMem)
end
function ZSTD_createCStream_advanced(customMem)
ccall((:ZSTD_createCStream_advanced, libzstd), Ptr{ZSTD_CStream}, (ZSTD_customMem,), customMem)
end
function ZSTD_createDCtx_advanced(customMem)
ccall((:ZSTD_createDCtx_advanced, libzstd), Ptr{ZSTD_DCtx}, (ZSTD_customMem,), customMem)
end
function ZSTD_createDStream_advanced(customMem)
ccall((:ZSTD_createDStream_advanced, libzstd), Ptr{ZSTD_DStream}, (ZSTD_customMem,), customMem)
end
function ZSTD_createCDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, cParams, customMem)
ccall((:ZSTD_createCDict_advanced, libzstd), Ptr{ZSTD_CDict}, (Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e, ZSTD_compressionParameters, ZSTD_customMem), dict, dictSize, dictLoadMethod, dictContentType, cParams, customMem)
end
mutable struct POOL_ctx_s end
const ZSTD_threadPool = POOL_ctx_s
function ZSTD_createThreadPool(numThreads)
ccall((:ZSTD_createThreadPool, libzstd), Ptr{ZSTD_threadPool}, (Csize_t,), numThreads)
end
function ZSTD_freeThreadPool(pool)
ccall((:ZSTD_freeThreadPool, libzstd), Cvoid, (Ptr{ZSTD_threadPool},), pool)
end
function ZSTD_CCtx_refThreadPool(cctx, pool)
ccall((:ZSTD_CCtx_refThreadPool, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_threadPool}), cctx, pool)
end
function ZSTD_createCDict_advanced2(dict, dictSize, dictLoadMethod, dictContentType, cctxParams, customMem)
ccall((:ZSTD_createCDict_advanced2, libzstd), Ptr{ZSTD_CDict}, (Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e, Ptr{ZSTD_CCtx_params}, ZSTD_customMem), dict, dictSize, dictLoadMethod, dictContentType, cctxParams, customMem)
end
function ZSTD_createDDict_advanced(dict, dictSize, dictLoadMethod, dictContentType, customMem)
ccall((:ZSTD_createDDict_advanced, libzstd), Ptr{ZSTD_DDict}, (Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e, ZSTD_customMem), dict, dictSize, dictLoadMethod, dictContentType, customMem)
end
function ZSTD_createCDict_byReference(dictBuffer, dictSize, compressionLevel)
ccall((:ZSTD_createCDict_byReference, libzstd), Ptr{ZSTD_CDict}, (Ptr{Cvoid}, Csize_t, Cint), dictBuffer, dictSize, compressionLevel)
end
function ZSTD_getCParams(compressionLevel, estimatedSrcSize, dictSize)
ccall((:ZSTD_getCParams, libzstd), ZSTD_compressionParameters, (Cint, Culonglong, Csize_t), compressionLevel, estimatedSrcSize, dictSize)
end
function ZSTD_getParams(compressionLevel, estimatedSrcSize, dictSize)
ccall((:ZSTD_getParams, libzstd), ZSTD_parameters, (Cint, Culonglong, Csize_t), compressionLevel, estimatedSrcSize, dictSize)
end
function ZSTD_checkCParams(params)
ccall((:ZSTD_checkCParams, libzstd), Csize_t, (ZSTD_compressionParameters,), params)
end
function ZSTD_adjustCParams(cPar, srcSize, dictSize)
ccall((:ZSTD_adjustCParams, libzstd), ZSTD_compressionParameters, (ZSTD_compressionParameters, Culonglong, Csize_t), cPar, srcSize, dictSize)
end
function ZSTD_CCtx_setCParams(cctx, cparams)
ccall((:ZSTD_CCtx_setCParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, ZSTD_compressionParameters), cctx, cparams)
end
function ZSTD_CCtx_setFParams(cctx, fparams)
ccall((:ZSTD_CCtx_setFParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, ZSTD_frameParameters), cctx, fparams)
end
function ZSTD_CCtx_setParams(cctx, params)
ccall((:ZSTD_CCtx_setParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, ZSTD_parameters), cctx, params)
end
function ZSTD_compress_advanced(cctx, dst, dstCapacity, src, srcSize, dict, dictSize, params)
ccall((:ZSTD_compress_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, ZSTD_parameters), cctx, dst, dstCapacity, src, srcSize, dict, dictSize, params)
end
function ZSTD_compress_usingCDict_advanced(cctx, dst, dstCapacity, src, srcSize, cdict, fParams)
ccall((:ZSTD_compress_usingCDict_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t, Ptr{ZSTD_CDict}, ZSTD_frameParameters), cctx, dst, dstCapacity, src, srcSize, cdict, fParams)
end
function ZSTD_CCtx_loadDictionary_byReference(cctx, dict, dictSize)
ccall((:ZSTD_CCtx_loadDictionary_byReference, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t), cctx, dict, dictSize)
end
function ZSTD_CCtx_loadDictionary_advanced(cctx, dict, dictSize, dictLoadMethod, dictContentType)
ccall((:ZSTD_CCtx_loadDictionary_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e), cctx, dict, dictSize, dictLoadMethod, dictContentType)
end
function ZSTD_CCtx_refPrefix_advanced(cctx, prefix, prefixSize, dictContentType)
ccall((:ZSTD_CCtx_refPrefix_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, ZSTD_dictContentType_e), cctx, prefix, prefixSize, dictContentType)
end
function ZSTD_CCtx_getParameter(cctx, param, value)
ccall((:ZSTD_CCtx_getParameter, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, ZSTD_cParameter, Ptr{Cint}), cctx, param, value)
end
function ZSTD_createCCtxParams()
ccall((:ZSTD_createCCtxParams, libzstd), Ptr{ZSTD_CCtx_params}, ())
end
function ZSTD_freeCCtxParams(params)
ccall((:ZSTD_freeCCtxParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params},), params)
end
function ZSTD_CCtxParams_reset(params)
ccall((:ZSTD_CCtxParams_reset, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params},), params)
end
function ZSTD_CCtxParams_init(cctxParams, compressionLevel)
ccall((:ZSTD_CCtxParams_init, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params}, Cint), cctxParams, compressionLevel)
end
function ZSTD_CCtxParams_init_advanced(cctxParams, params)
ccall((:ZSTD_CCtxParams_init_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params}, ZSTD_parameters), cctxParams, params)
end
function ZSTD_CCtxParams_setParameter(params, param, value)
ccall((:ZSTD_CCtxParams_setParameter, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params}, ZSTD_cParameter, Cint), params, param, value)
end
function ZSTD_CCtxParams_getParameter(params, param, value)
ccall((:ZSTD_CCtxParams_getParameter, libzstd), Csize_t, (Ptr{ZSTD_CCtx_params}, ZSTD_cParameter, Ptr{Cint}), params, param, value)
end
function ZSTD_CCtx_setParametersUsingCCtxParams(cctx, params)
ccall((:ZSTD_CCtx_setParametersUsingCCtxParams, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_CCtx_params}), cctx, params)
end
function ZSTD_compressStream2_simpleArgs(cctx, dst, dstCapacity, dstPos, src, srcSize, srcPos, endOp)
ccall((:ZSTD_compressStream2_simpleArgs, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Csize_t}, Ptr{Cvoid}, Csize_t, Ptr{Csize_t}, ZSTD_EndDirective), cctx, dst, dstCapacity, dstPos, src, srcSize, srcPos, endOp)
end
function ZSTD_isFrame(buffer, size)
ccall((:ZSTD_isFrame, libzstd), Cuint, (Ptr{Cvoid}, Csize_t), buffer, size)
end
function ZSTD_createDDict_byReference(dictBuffer, dictSize)
ccall((:ZSTD_createDDict_byReference, libzstd), Ptr{ZSTD_DDict}, (Ptr{Cvoid}, Csize_t), dictBuffer, dictSize)
end
function ZSTD_DCtx_loadDictionary_byReference(dctx, dict, dictSize)
ccall((:ZSTD_DCtx_loadDictionary_byReference, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t), dctx, dict, dictSize)
end
function ZSTD_DCtx_loadDictionary_advanced(dctx, dict, dictSize, dictLoadMethod, dictContentType)
ccall((:ZSTD_DCtx_loadDictionary_advanced, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, ZSTD_dictLoadMethod_e, ZSTD_dictContentType_e), dctx, dict, dictSize, dictLoadMethod, dictContentType)
end
function ZSTD_DCtx_refPrefix_advanced(dctx, prefix, prefixSize, dictContentType)
ccall((:ZSTD_DCtx_refPrefix_advanced, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, ZSTD_dictContentType_e), dctx, prefix, prefixSize, dictContentType)
end
function ZSTD_DCtx_setMaxWindowSize(dctx, maxWindowSize)
ccall((:ZSTD_DCtx_setMaxWindowSize, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Csize_t), dctx, maxWindowSize)
end
function ZSTD_DCtx_getParameter(dctx, param, value)
ccall((:ZSTD_DCtx_getParameter, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, ZSTD_dParameter, Ptr{Cint}), dctx, param, value)
end
function ZSTD_DCtx_setFormat(dctx, format)
ccall((:ZSTD_DCtx_setFormat, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, ZSTD_format_e), dctx, format)
end
function ZSTD_decompressStream_simpleArgs(dctx, dst, dstCapacity, dstPos, src, srcSize, srcPos)
ccall((:ZSTD_decompressStream_simpleArgs, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, Ptr{Csize_t}, Ptr{Cvoid}, Csize_t, Ptr{Csize_t}), dctx, dst, dstCapacity, dstPos, src, srcSize, srcPos)
end
function ZSTD_initCStream_srcSize(zcs, compressionLevel, pledgedSrcSize)
ccall((:ZSTD_initCStream_srcSize, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Cint, Culonglong), zcs, compressionLevel, pledgedSrcSize)
end
function ZSTD_initCStream_usingDict(zcs, dict, dictSize, compressionLevel)
ccall((:ZSTD_initCStream_usingDict, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{Cvoid}, Csize_t, Cint), zcs, dict, dictSize, compressionLevel)
end
function ZSTD_initCStream_advanced(zcs, dict, dictSize, params, pledgedSrcSize)
ccall((:ZSTD_initCStream_advanced, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{Cvoid}, Csize_t, ZSTD_parameters, Culonglong), zcs, dict, dictSize, params, pledgedSrcSize)
end
function ZSTD_initCStream_usingCDict(zcs, cdict)
ccall((:ZSTD_initCStream_usingCDict, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{ZSTD_CDict}), zcs, cdict)
end
function ZSTD_initCStream_usingCDict_advanced(zcs, cdict, fParams, pledgedSrcSize)
ccall((:ZSTD_initCStream_usingCDict_advanced, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Ptr{ZSTD_CDict}, ZSTD_frameParameters, Culonglong), zcs, cdict, fParams, pledgedSrcSize)
end
function ZSTD_resetCStream(zcs, pledgedSrcSize)
ccall((:ZSTD_resetCStream, libzstd), Csize_t, (Ptr{ZSTD_CStream}, Culonglong), zcs, pledgedSrcSize)
end
struct ZSTD_frameProgression
ingested::Culonglong
consumed::Culonglong
produced::Culonglong
flushed::Culonglong
currentJobID::Cuint
nbActiveWorkers::Cuint
end
function ZSTD_getFrameProgression(cctx)
ccall((:ZSTD_getFrameProgression, libzstd), ZSTD_frameProgression, (Ptr{ZSTD_CCtx},), cctx)
end
function ZSTD_toFlushNow(cctx)
ccall((:ZSTD_toFlushNow, libzstd), Csize_t, (Ptr{ZSTD_CCtx},), cctx)
end
function ZSTD_initDStream_usingDict(zds, dict, dictSize)
ccall((:ZSTD_initDStream_usingDict, libzstd), Csize_t, (Ptr{ZSTD_DStream}, Ptr{Cvoid}, Csize_t), zds, dict, dictSize)
end
function ZSTD_initDStream_usingDDict(zds, ddict)
ccall((:ZSTD_initDStream_usingDDict, libzstd), Csize_t, (Ptr{ZSTD_DStream}, Ptr{ZSTD_DDict}), zds, ddict)
end
function ZSTD_resetDStream(zds)
ccall((:ZSTD_resetDStream, libzstd), Csize_t, (Ptr{ZSTD_DStream},), zds)
end
# typedef size_t ( * ZSTD_sequenceProducer_F ) ( void * sequenceProducerState , ZSTD_Sequence * outSeqs , size_t outSeqsCapacity , const void * src , size_t srcSize , const void * dict , size_t dictSize , int compressionLevel , size_t windowSize )
const ZSTD_sequenceProducer_F = Ptr{Cvoid}
function ZSTD_registerSequenceProducer(cctx, sequenceProducerState, sequenceProducer)
ccall((:ZSTD_registerSequenceProducer, libzstd), Cvoid, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, ZSTD_sequenceProducer_F), cctx, sequenceProducerState, sequenceProducer)
end
function ZSTD_CCtxParams_registerSequenceProducer(params, sequenceProducerState, sequenceProducer)
ccall((:ZSTD_CCtxParams_registerSequenceProducer, libzstd), Cvoid, (Ptr{ZSTD_CCtx_params}, Ptr{Cvoid}, ZSTD_sequenceProducer_F), params, sequenceProducerState, sequenceProducer)
end
function ZSTD_compressBegin(cctx, compressionLevel)
ccall((:ZSTD_compressBegin, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Cint), cctx, compressionLevel)
end
function ZSTD_compressBegin_usingDict(cctx, dict, dictSize, compressionLevel)
ccall((:ZSTD_compressBegin_usingDict, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Cint), cctx, dict, dictSize, compressionLevel)
end
function ZSTD_compressBegin_usingCDict(cctx, cdict)
ccall((:ZSTD_compressBegin_usingCDict, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_CDict}), cctx, cdict)
end
function ZSTD_copyCCtx(cctx, preparedCCtx, pledgedSrcSize)
ccall((:ZSTD_copyCCtx, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_CCtx}, Culonglong), cctx, preparedCCtx, pledgedSrcSize)
end
function ZSTD_compressContinue(cctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_compressContinue, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), cctx, dst, dstCapacity, src, srcSize)
end
function ZSTD_compressEnd(cctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_compressEnd, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), cctx, dst, dstCapacity, src, srcSize)
end
function ZSTD_compressBegin_advanced(cctx, dict, dictSize, params, pledgedSrcSize)
ccall((:ZSTD_compressBegin_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, ZSTD_parameters, Culonglong), cctx, dict, dictSize, params, pledgedSrcSize)
end
function ZSTD_compressBegin_usingCDict_advanced(cctx, cdict, fParams, pledgedSrcSize)
ccall((:ZSTD_compressBegin_usingCDict_advanced, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{ZSTD_CDict}, ZSTD_frameParameters, Culonglong), cctx, cdict, fParams, pledgedSrcSize)
end
function ZSTD_decodingBufferSize_min(windowSize, frameContentSize)
ccall((:ZSTD_decodingBufferSize_min, libzstd), Csize_t, (Culonglong, Culonglong), windowSize, frameContentSize)
end
function ZSTD_decompressBegin(dctx)
ccall((:ZSTD_decompressBegin, libzstd), Csize_t, (Ptr{ZSTD_DCtx},), dctx)
end
function ZSTD_decompressBegin_usingDict(dctx, dict, dictSize)
ccall((:ZSTD_decompressBegin_usingDict, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t), dctx, dict, dictSize)
end
function ZSTD_decompressBegin_usingDDict(dctx, ddict)
ccall((:ZSTD_decompressBegin_usingDDict, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{ZSTD_DDict}), dctx, ddict)
end
function ZSTD_nextSrcSizeToDecompress(dctx)
ccall((:ZSTD_nextSrcSizeToDecompress, libzstd), Csize_t, (Ptr{ZSTD_DCtx},), dctx)
end
function ZSTD_decompressContinue(dctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_decompressContinue, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), dctx, dst, dstCapacity, src, srcSize)
end
function ZSTD_copyDCtx(dctx, preparedDCtx)
ccall((:ZSTD_copyDCtx, libzstd), Cvoid, (Ptr{ZSTD_DCtx}, Ptr{ZSTD_DCtx}), dctx, preparedDCtx)
end
@enum ZSTD_nextInputType_e::UInt32 begin
ZSTDnit_frameHeader = 0
ZSTDnit_blockHeader = 1
ZSTDnit_block = 2
ZSTDnit_lastBlock = 3
ZSTDnit_checksum = 4
ZSTDnit_skippableFrame = 5
end
function ZSTD_nextInputType(dctx)
ccall((:ZSTD_nextInputType, libzstd), ZSTD_nextInputType_e, (Ptr{ZSTD_DCtx},), dctx)
end
function ZSTD_getBlockSize(cctx)
ccall((:ZSTD_getBlockSize, libzstd), Csize_t, (Ptr{ZSTD_CCtx},), cctx)
end
function ZSTD_compressBlock(cctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_compressBlock, libzstd), Csize_t, (Ptr{ZSTD_CCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), cctx, dst, dstCapacity, src, srcSize)
end
function ZSTD_decompressBlock(dctx, dst, dstCapacity, src, srcSize)
ccall((:ZSTD_decompressBlock, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t, Ptr{Cvoid}, Csize_t), dctx, dst, dstCapacity, src, srcSize)
end
function ZSTD_insertBlock(dctx, blockStart, blockSize)
ccall((:ZSTD_insertBlock, libzstd), Csize_t, (Ptr{ZSTD_DCtx}, Ptr{Cvoid}, Csize_t), dctx, blockStart, blockSize)
end
@enum ZSTD_ErrorCode::UInt32 begin
ZSTD_error_no_error = 0
ZSTD_error_GENERIC = 1
ZSTD_error_prefix_unknown = 10
ZSTD_error_version_unsupported = 12
ZSTD_error_frameParameter_unsupported = 14
ZSTD_error_frameParameter_windowTooLarge = 16
ZSTD_error_corruption_detected = 20
ZSTD_error_checksum_wrong = 22
ZSTD_error_literals_headerWrong = 24
ZSTD_error_dictionary_corrupted = 30
ZSTD_error_dictionary_wrong = 32
ZSTD_error_dictionaryCreation_failed = 34
ZSTD_error_parameter_unsupported = 40
ZSTD_error_parameter_combination_unsupported = 41
ZSTD_error_parameter_outOfBound = 42
ZSTD_error_tableLog_tooLarge = 44
ZSTD_error_maxSymbolValue_tooLarge = 46