Abstraction layer over Zstandard (zstd).
Generic Zstandard compression function.
Compresses input string using the zstd simple context function. If no
compression level is passed, the Zstandard default is used. The
Zstandard context context
has to be destroy with
dm_zstd_destroy()
once finished.
The string output
may be larger than the actual length. The
argument output_len
contains the actual length.
The function returns the following error codes:
E_ALLOC
if the allocation of the output string failed.E_EMPTY
if the compressed size is 0.E_ZSTD
if the compression failed.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(zstd_context_type), | intent(inout) | :: | context |
Zstandard context type. |
||
character(len=*), | intent(inout) | :: | input |
Input bytes. |
||
character(len=:), | intent(out), | allocatable | :: | output |
Output bytes. |
|
integer, | intent(in), | optional | :: | level |
Compression level. |
|
integer(kind=i8), | intent(in), | optional | :: | input_len |
Actual input length. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Actual output length. |
Compresses input string using the zstd simple function. If no compression level is passed, the Zstandard default is used.
The string output
may be larger than the actual length. The
argument output_len
contains the actual length.
The function returns the following error codes:
E_ALLOC
if the allocation of the output string failed.E_EMPTY
if the compressed size is 0.E_ZSTD
if the compression failed.Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | input |
Input bytes. |
||
character(len=:), | intent(out), | allocatable | :: | output |
Output bytes. |
|
integer, | intent(in), | optional | :: | level |
Compression level. |
|
integer(kind=i8), | intent(in), | optional | :: | input_len |
Actual input length. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Actual output length. |
Generic Zstandard decompression function.
Uncompresses input string using the zstd simple context function. The
output buffer must be large enough to hold the uncompressed result.
The function returns E_ZSTD
if the decompression failed. The
Zstandard context type context
has to be destroyed with
dm_zstd_destroy()
once finished.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(zstd_context_type), | intent(inout) | :: | context |
Zstandard context type. |
||
character(len=*), | intent(inout) | :: | input |
Input bytes. |
||
character(len=*), | intent(inout) | :: | output |
Output bytes. |
||
integer(kind=i8), | intent(in), | optional | :: | input_len |
Actual input length. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Actual output length. |
Uncompresses input string using the zstd simple function. The output
buffer must be large enough to hold the uncompressed result. The
function returns E_ZSTD
if the decompression failed.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(inout) | :: | input |
Input bytes. |
||
character(len=*), | intent(inout) | :: | output |
Output bytes. |
||
integer(kind=i8), | intent(in), | optional | :: | input_len |
Actual input length. |
|
integer(kind=i8), | intent(out), | optional | :: | output_len |
Actual output length. |
Opaque Zstandard context type.
Destroys Zstandard context created with zstd_compress_multi()
or
zstd_uncompress_multi()
. The function returns E_ZSTD
on error.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(zstd_context_type), | intent(inout) | :: | context |
Zstandard context type. |
Returns default zstd compression level.
Returns maximum zstd compression level.
Returns minimum zstd compression level.
Returns zstd library version as allocatable string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
logical, | intent(in), | optional | :: | name |
Add prefix |