1 module zstd.c.zstd;
2 
3 extern (C):
4 @trusted:
5 
6 alias ZSTD_CCtx_s ZSTD_CCtx;
7 alias ZSTD_DCtx_s ZSTD_DCtx;
8 alias ZSTD_CDict_s ZSTD_CDict;
9 alias ZSTD_DDict_s ZSTD_DDict;
10 alias ZSTD_inBuffer_s ZSTD_inBuffer;
11 alias ZSTD_outBuffer_s ZSTD_outBuffer;
12 alias ZSTD_CStream_s ZSTD_CStream;
13 alias ZSTD_DStream_s ZSTD_DStream;
14 
15 struct ZSTD_inBuffer_s
16 {
17     const(void)* src;
18     size_t size;
19     size_t pos;
20 }
21 
22 struct ZSTD_outBuffer_s
23 {
24     void* dst;
25     size_t size;
26     size_t pos;
27 }
28 
29 struct ZSTD_DStream_s;
30 
31 
32 struct ZSTD_CCtx_s;
33 
34 
35 struct ZSTD_CStream_s;
36 
37 
38 struct ZSTD_DDict_s;
39 
40 
41 struct ZSTD_DCtx_s;
42 
43 
44 struct ZSTD_CDict_s;
45 
46 
47 uint ZSTD_versionNumber ();
48 size_t ZSTD_compress (void* dst, size_t dstCapacity, const(void)* src, size_t srcSize, int compressionLevel);
49 size_t ZSTD_getDecompressedSize (const(void)* src, size_t srcSize);
50 size_t ZSTD_decompress (void* dst, size_t dstCapacity, const(void)* src, size_t compressedSize);
51 int ZSTD_maxCLevel ();
52 size_t ZSTD_compressBound (size_t srcSize);
53 uint ZSTD_isError (size_t code);
54 const(char)* ZSTD_getErrorName (size_t code);
55 ZSTD_CCtx* ZSTD_createCCtx ();
56 size_t ZSTD_freeCCtx (ZSTD_CCtx* cctx);
57 size_t ZSTD_compressCCtx (ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const(void)* src, size_t srcSize, int compressionLevel);
58 ZSTD_DCtx* ZSTD_createDCtx ();
59 size_t ZSTD_freeDCtx (ZSTD_DCtx* dctx);
60 size_t ZSTD_decompressDCtx (ZSTD_DCtx* ctx, void* dst, size_t dstCapacity, const(void)* src, size_t srcSize);
61 size_t ZSTD_compress_usingDict (ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const(void)* src, size_t srcSize, const(void)* dict, size_t dictSize, int compressionLevel);
62 size_t ZSTD_decompress_usingDict (ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const(void)* src, size_t srcSize, const(void)* dict, size_t dictSize);
63 ZSTD_CDict* ZSTD_createCDict (const(void)* dict, size_t dictSize, int compressionLevel);
64 size_t ZSTD_freeCDict (ZSTD_CDict* CDict);
65 size_t ZSTD_compress_usingCDict (ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const(void)* src, size_t srcSize, const(ZSTD_CDict)* cdict);
66 ZSTD_DDict* ZSTD_createDDict (const(void)* dict, size_t dictSize);
67 size_t ZSTD_freeDDict (ZSTD_DDict* ddict);
68 size_t ZSTD_decompress_usingDDict (ZSTD_DCtx* dctx, void* dst, size_t dstCapacity, const(void)* src, size_t srcSize, const(ZSTD_DDict)* ddict);
69 ZSTD_CStream* ZSTD_createCStream ();
70 size_t ZSTD_freeCStream (ZSTD_CStream* zcs);
71 size_t ZSTD_CStreamInSize ();
72 size_t ZSTD_CStreamOutSize ();
73 size_t ZSTD_initCStream (ZSTD_CStream* zcs, int compressionLevel);
74 size_t ZSTD_compressStream (ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
75 size_t ZSTD_flushStream (ZSTD_CStream* zcs, ZSTD_outBuffer* output);
76 size_t ZSTD_endStream (ZSTD_CStream* zcs, ZSTD_outBuffer* output);
77 ZSTD_DStream* ZSTD_createDStream ();
78 size_t ZSTD_freeDStream (ZSTD_DStream* zds);
79 size_t ZSTD_DStreamInSize ();
80 size_t ZSTD_DStreamOutSize ();
81 size_t ZSTD_initDStream (ZSTD_DStream* zds);
82 size_t ZSTD_decompressStream (ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);